You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into something weird today. I have 2 valid polygons. After
invoking union on them the result is a GeometryCollection with a
LineString inside. I would not expect the union of Polygons to lead to
LineStrings? It is of course also possible that I oversee something.
This is due to topology collapse happening because geometry A has a very narrow spike near POINT ( 546139.127 6290438.223 ) which falls outside geometry B. When the spike is noded with geometry B the outside portion collapses to a line segment.
JTS has always had the feature that overlay operations return ALL components of the result regardless of dimension. This was done to avoid losing information. A different semantic of returning only the highest-dimension resultants could have been chosen. Perhaps that should be provided as an option.
Thanks @dr-jts. For now, when I get a geometry collection I use the PolygonExtracter to create a new MultiPolygon. Is this a recommended way of handling the situation?
I ran into something weird today. I have 2 valid polygons. After
invoking
union
on them the result is a GeometryCollection with aLineString inside. I would not expect the union of Polygons to lead to
LineStrings? It is of course also possible that I oversee something.
geom1-wkt: "MULTIPOLYGON (((546132.889 6290404.306, 546132.268 6290443.796, 546139.126 6290438.224, 546128.599 6290446.777, 546109.556 6290423.732, 546132.889 6290404.306)))"
geom2-wkt: "MULTIPOLYGON (((546132.27 6290443.792, 546132.268 6290443.786, 546132.889 6290404.317, 546132.897 6290404.299, 546135.837 6290401.852, 546135.844 6290401.85, 546135.845 6290401.85, 546135.852 6290401.85, 546140.089 6290403.894, 546140.4 6290404.045, 546140.405 6290404.057, 546140.405 6290404.277, 546140.286 6290437.351, 546140.283 6290437.359, 546140.28 6290437.364, 546139.127 6290438.223, 546139.125 6290438.225, 546132.275 6290443.79, 546132.27 6290443.792)))""
resulting-union-wkt: "GEOMETRYCOLLECTION (LINESTRING (546139.1259999973 6290438.224000002, 546139.126 6290438.224), POLYGON ((546132.563714283 6290424.991238262, 546132.889 6290404.306, 546109.556 6290423.732, 546128.599 6290446.777, 546136.5712956785 6290440.299651759, 546139.125 6290438.225, 546139.1259999973 6290438.224000002, 546139.127 6290438.223, 546140.28 6290437.364, 546140.283 6290437.359, 546140.286 6290437.351, 546140.405 6290404.277, 546140.405 6290404.057, 546140.4 6290404.045, 546140.089 6290403.894, 546135.852 6290401.85, 546135.845 6290401.85, 546135.844 6290401.85, 546135.837 6290401.852, 546132.897 6290404.299, 546132.889 6290404.317, 546132.563714283 6290424.991238262), (546136.5567565103 6290440.311463506, 546132.268 6290443.796, 546132.2681501706 6290443.786450512, 546132.27 6290443.792, 546132.275 6290443.79, 546136.5567565103 6290440.311463506)))"
The text was updated successfully, but these errors were encountered: