On Wed, 16 Feb 2022, Even Rouault wrote:

That said I've tried replicated using https://github.com/qgis/QGIS/files/8058606/Issue47288_Polygons_GPKG.zip from the QGIS ticket and converting it to shapefile. The issue here is that the original geometry is not (considered as) valid:

$ ogrinfo Issue47288_Polygons.gpkg -sql "select st_isvalid(geom) from Issue47288_Polygons" -al -q GEOS warning: Self-intersection at or near point 352107.37400937825 5662263.0605139844 54.963999999999999

Layer name: SELECT
OGRFeature(SELECT):0
  st_isvalid(geom) (Integer) = 0

As far as I can see in this multipolygon, there are 2 issues: one of the part is repeated, and the 2 "small" rectangular polygons that share the 352107.37400937825 5662263.0605139844 54.963999999999999 points are likely non-planar.

My inclination would be to consider that in the case where we have a
multipolygon with non -coplanar parts we should probably be avoiding
considering the ones that are non-coplanar are inner/outer rings of
others.

I've ticketed that in https://github.com/OSGeo/gdal/issues/5315

IIUC, whether a polygon is planar depends upon the CRS, just as
transforming a straight line to another CRS may produce a non-straight
line.
If so, do we have to worry about this ?

--
Andrew C. Aitchison                                     Kendal, UK
                        [email protected]
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to