-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Isisminer does not properly handle the presence of bad (e.g. self-intersecting) polygons. #5612
Comments
@kledmundson Couple insights/questions. Is there a planned fix from the yourself or Kris coming in for this? Second, is seems related to #5553 |
Yes, fix is coming.
Relation to #5553 I'm not sure about, will have to look.
…On Thu, Sep 12, 2024 at 11:27 AM Adam Paquette ***@***.***> wrote:
@kledmundson <https://github.com/kledmundson> Couple insights/questions.
Is there a planned fix from the yourself or Kris coming in for this?
Second, is seems related to #5553
<#5553>
—
Reply to this email directly, view it on GitHub
<#5612 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUGSUXEHFHUGZGBVU3CCS3ZWHMJ5AVCNFSM6AAAAABODWQW4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBWHE3DSNJTG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This fix is not directly related to #5553 because GisGeometry uses the GEOS C-API. Code in PolygonTools uses the C++ API so they are separate. We added a They are likely related as some GIsFootprints created by ISIS have self-intersections. These leak through into isisminer processing and aborts the run. The fix that @kledmundson is providing runs a |
* GisGeometry was throwing an exception when isValid() was called and the geometry was indeed invalid * GisGeometry - added buffer() method * Strategy was updated to better manage geometries * Strategy - Added RepairInvalidGeometry and InvalidGeometryAction to allow better user control over invalid geometries * Strategy - Apply buffer(0) algorithm when an invalid geometry is detected * Strategy - Added more debug output
…5612. * GisGeometry was throwing an exception when isValid() was called and the geometry was indeed invalid * GisGeometry - added buffer() method * Strategy was updated to better manage geometries * Strategy - Added RepairInvalidGeometry and InvalidGeometryAction to allow better user control over invalid geometries * Strategy - Apply buffer(0) algorithm when an invalid geometry is detected * Strategy - Added more debug output * isisminer - improved handling of invalid/bad geometries * isisminer - Documented new parameters RepairInvalidGeometry and InvalidGeometryAction and updated Calculator strategy documentation
…n geometries were not treated properly. Added pertinent unit tests to GisGeometry and Strategy classes. Fixed incorrect links and minor typos in isisminer documentation. Addresses DOI-USGS#5612.
* GisGeometry was throwing an exception when isValid() was called and the geometry was indeed invalid * GisGeometry - added buffer() method * Strategy was updated to better manage geometries * Strategy - Added RepairInvalidGeometry and InvalidGeometryAction to allow better user control over invalid geometries * Strategy - Apply buffer(0) algorithm when an invalid geometry is detected * Strategy - Added more debug output
…5612. * GisGeometry was throwing an exception when isValid() was called and the geometry was indeed invalid * GisGeometry - added buffer() method * Strategy was updated to better manage geometries * Strategy - Added RepairInvalidGeometry and InvalidGeometryAction to allow better user control over invalid geometries * Strategy - Apply buffer(0) algorithm when an invalid geometry is detected * Strategy - Added more debug output * isisminer - improved handling of invalid/bad geometries * isisminer - Documented new parameters RepairInvalidGeometry and InvalidGeometryAction and updated Calculator strategy documentation
…n geometries were not treated properly. Added pertinent unit tests to GisGeometry and Strategy classes. Fixed incorrect links and minor typos in isisminer documentation. Addresses DOI-USGS#5612.
…eometries. (#5620) * Fixed issues with GisGeometry/Strategy classes. Addresses #5612. * GisGeometry was throwing an exception when isValid() was called and the geometry was indeed invalid * GisGeometry - added buffer() method * Strategy was updated to better manage geometries * Strategy - Added RepairInvalidGeometry and InvalidGeometryAction to allow better user control over invalid geometries * Strategy - Apply buffer(0) algorithm when an invalid geometry is detected * Strategy - Added more debug output * Corrected invalid geometry problems in isisminer. Addresses #5612. * GisGeometry was throwing an exception when isValid() was called and the geometry was indeed invalid * GisGeometry - added buffer() method * Strategy was updated to better manage geometries * Strategy - Added RepairInvalidGeometry and InvalidGeometryAction to allow better user control over invalid geometries * Strategy - Apply buffer(0) algorithm when an invalid geometry is detected * Strategy - Added more debug output * isisminer - improved handling of invalid/bad geometries * isisminer - Documented new parameters RepairInvalidGeometry and InvalidGeometryAction and updated Calculator strategy documentation * Fixed a bug in isisminer in which bad (e.g. self-intersecting) polygon geometries were not treated properly. Added pertinent unit tests to GisGeometry and Strategy classes. Fixed incorrect links and minor typos in isisminer documentation. Addresses #5612. * Per reviewer comments, corrected additional typos in GisGeometry.cpp. Addresses #5612. --------- Co-authored-by: Kris J. Becker <[email protected]>
Closed via #5620. |
…eometries. (DOI-USGS#5620) * Fixed issues with GisGeometry/Strategy classes. Addresses DOI-USGS#5612. * GisGeometry was throwing an exception when isValid() was called and the geometry was indeed invalid * GisGeometry - added buffer() method * Strategy was updated to better manage geometries * Strategy - Added RepairInvalidGeometry and InvalidGeometryAction to allow better user control over invalid geometries * Strategy - Apply buffer(0) algorithm when an invalid geometry is detected * Strategy - Added more debug output * Corrected invalid geometry problems in isisminer. Addresses DOI-USGS#5612. * GisGeometry was throwing an exception when isValid() was called and the geometry was indeed invalid * GisGeometry - added buffer() method * Strategy was updated to better manage geometries * Strategy - Added RepairInvalidGeometry and InvalidGeometryAction to allow better user control over invalid geometries * Strategy - Apply buffer(0) algorithm when an invalid geometry is detected * Strategy - Added more debug output * isisminer - improved handling of invalid/bad geometries * isisminer - Documented new parameters RepairInvalidGeometry and InvalidGeometryAction and updated Calculator strategy documentation * Fixed a bug in isisminer in which bad (e.g. self-intersecting) polygon geometries were not treated properly. Added pertinent unit tests to GisGeometry and Strategy classes. Fixed incorrect links and minor typos in isisminer documentation. Addresses DOI-USGS#5612. * Per reviewer comments, corrected additional typos in GisGeometry.cpp. Addresses DOI-USGS#5612. --------- Co-authored-by: Kris J. Becker <[email protected]>
ISIS version(s) affected: x.y.z
dev
Description
The footprintinit application will sometimes create invalid, self-intersecting polygons. The isisminer application detects bad polygons, reports them, and terminates instead of attempting to repair them.
Solution
In many cases, self-intersecting polygons can be repaired by creating a buffer of size 0 around the polygon. This is analogous to stretching a rubber band around all points in the polygon (see slide below). The buffer(0) approach will likely fix many (though possibly not all) self-intersecting polygons. While the fix should be incorporated into footprintinit, it should also be implemented in isisminer.
Additional context
The slide below shows a polygon with a highlighted self-intersection in blue. The self-intersection was repaired (shown in orange) by applying a buffer of 0.1 around all polygon vertices. Note that typically a buffer of size 0 is applied. Here, a buffer of 0.1 was used for illustration purposes only.
The text was updated successfully, but these errors were encountered: