[gdal-dev] Fwd: Gdal - multipolygon - geometry errors instead holes
Even Rouault
even.rouault at spatialys.com
Thu Oct 31 04:00:59 PDT 2019
On mardi 29 octobre 2019 03:31:10 CET jratike80 wrote:
> Hi,
>
> Your case is a bit hard to analyze with end users tools, probably low level
> study about how the shapefile driver or GEOS works is needed.
>
> The problematic geometry is a rather big multipolygon and it can be found
> with ogrinfo
>
> ogrinfo -dialect sqlite -sql "select *, ST_IsValidReason(geometry) from
> original where st_isvalid(geometry)=0" original.shp
>
> The geometry is the Nested Shells case.
>
> I opened the same shapefile with OpenJUMP and it shows that certain
> multipolygon part with a hole. The QA tool, that is based on JTS does not
> show topology errors. I saved the layer into a) shapefile and b) into JUMP
> jml format with OpenJUMP and repeated the test with ogrinfo and
> IsValidReason. The shapefile seems to contain an invalid geometry while jml
> file not.
>
> It seems that the shapefile driver has some issue with reading that
> geometry. OpenJUMP considers that the geometry is OK both when reading and
> writing.
>
> I deleted manually parts from the multipolygon by utilizing the Select Parts
> tool of OpenJUMP and managed to shrink the error into this shapefile
> http://latuviitta.org/downloads/just_error.zip that contains only this one
> geometry
Thanks for the simplified test case. That was indeed a bug in OGR multipolygon
reconstruction from rings. Just fixed
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list