Closed tompeterken-os closed 1 year ago
@tompeterken-os Thank you for reporting this. We will prioritise the fix for the next release.
@tompeterken-os the problem was due to the fact intersection via geometry overlay in JTS returns GeometryCollection instead of MultiPolygon (expected) and we flatten this case to a single polygon, rather than to MultiPolygon. I will open a PR now that fixes this problem.
Just got round to checking this again. Fixed in version 0.3.10, thank you @milos-colic and team!
Describe the bug When a Polygon is being chipped by
grid_tessellate
orgrid_tessellateexplode
and the input geometrythe returned chip features only a single Polygon representing just one of the parts that should be returned.
The bug only appears using the JTS bindings. In ESRI mode, a MultiPolygon is returned as expected.
To Reproduce I've generated an example below, illustrating behaviour with two different test input geometries. I've output the chips into a geodataframe to illustrate with matplotlib and show the missing segments.
The geometries get chipped as shown: Firstly, the geometry with a segment aligning to the grid cell boundary. Two triangle parts are missing from the chip geometries.
Secondly, the same geometry but shifted so that the boundary does not align with the grid cell boundary. No parts are missing.
Expected behavior The union of chip geometries should always have equal coverage to the input geometries, regardless of whether the input geometry has a segment aligning to a grid cell boundary.
Additional context I'm using mosaic 0.3.7 with Databricks Runtime 11.3 LTS ML, Apache Spark 3.3.0, Scala 2.12. I'm using BNG indexing.