1

After applying the topology simplification mentioned in the answer Remove Slivers/Gaps generated after TopologyPreserveSimplification? It is retaining the topology but is removing the polygon. Below is the image and sample shapefile data for the same (https://github.com/gizmogaurav/spatialPoc/blob/main/poc.zip) Tolerance = .001

enter image description here

enter image description here

5
  • Why did you use this recipe? mapshaper can do the simplification mapshaper.org and you can tell it to preserver polygons while simplifying (no deletion)
    – ThomasG77
    Aug 16, 2021 at 21:40
  • I want to fully automate the process where manual intervention will not be involved , that's why I am trying to performed it using geotools in java and not wanted to use mapshaper, arcgis tools etc. Aug 17, 2021 at 3:43
  • My code assumes that the polygons share a single line - if there are any gaps in the original polygons then they will remain (and probably grow) in the simplification process.
    – Ian Turton
    Aug 17, 2021 at 7:41
  • No, there is no gap in the original polygon. They are sharing the same line. It is coming after simplification. I I shared the link for the original shape file in the question for the referenced. github.com/gizmogaurav/spatialPoc/blob/main/poc.zip) Tolerance = .001 Aug 17, 2021 at 9:19
  • mapshaper have a command line e.g github.com/mbloch/mapshaper/wiki/Command-Reference so can be fully automated with it. For you Java solution, can't really help: not good enough with Java development
    – ThomasG77
    Aug 17, 2021 at 9:57

1 Answer 1

1

As far as I can tell one of your polygons is "invalid" though QGis's validity checker disagrees with me.

enter image description here

As for why polygon 5 is not rebuilt, it seems to be related to the line in red which Polygonizer reports as a dangle. So again there may not be an exact match across those two polygons. Snapping to a grid might help but I haven't tried it.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.