Closed wcjochem closed 1 year ago
Thank you for reporting this @wcjochem. This is indeed a bug when using the ESRI geometry bindings. When constructing a multipolygon with ESRI we loose the order of the holes.
Please use JTS binding instead of the default ESRI one:
import mosaic as mos
spark.conf.set("spark.databricks.labs.mosaic.geometry.api", "JTS")
mos.enable_mosaic(spark, dbutils)
Thank you for following up and confirming, @edurdevic! Specifying JTS bindings does produce the expected behaviour.
Describe the bug I'm trying to explode a MultiPolygon feature (originally a GeoJSON string) into its constituent polygons using
st_dump
. The unexpected behaviour occurs when a MultiPolygon has a part containing a hole. In such a case, the hole is not associated with the correct exploded feature. The exception to this behaviour (which highlights the issue) is that the expected result does occur when the final part of the MultiPolygon is the feature containing a hole. If all parts of the MultiPolygon contain holes, then they all become associated with the final, exploded feature.To Reproduce Steps to reproduce the behavior:
Expected behavior The resulting data frame (
df
in the above example) should contain 3 polygon features. The second polygon should contain a hole.Screenshots
Additional context Using: Mosaic version 0.3.7, Databricks Runtime 11.3 LTS, Apache Spark 3.3.0, Scala 2.12