[gdal-dev] Clipping shapefile with another produces invalid shapes
Paul Meems
bontepaarden at gmail.com
Fri Oct 13 04:32:39 PDT 2017
Thanks Even and Jukka for the clarification.
Due to historical reasons, MapWinGIS is not using GDAL/OGR to read/write
shapefiles. It is using its own implementation.
For now, I will clip with OGR first and then fix with MapWinGIS, this will
produce valid shapes.
It does take a bit longer.
Should I create a test dataset to reproduce this issue. I'm not capable of
debugging GDAL myself.
Paul
*Paul Meems *
Release manager, configuration manager
and forum moderator of MapWindow GIS.
www.mapwindow.org
Owner of MapWindow.nl - Support for
Dutch speaking users.
www.mapwindow.nl
*The MapWindow GIS project has moved to GitHub
<https://github.com/MapWindow>!*
Download the latest MapWinGIS mapping engine.
<https://github.com/MapWindow/MapWinGIS/releases>
Download the latest MapWindow 5 open source desktop application.
<https://github.com/MapWindow/MapWindow5/releases>
2017-10-13 13:01 GMT+02:00 Even Rouault <even.rouault at spatialys.com>:
> On vendredi 13 octobre 2017 09:06:46 CEST Paul Meems wrote:
>
> > Thanks Even for your quick reply.
>
> >
>
> > I was using MapWinGIS to perform the validation and I assumed it was just
>
> > using GEOS.
>
> > I did a closer look at the code and it is first doing some internal
> checks
>
> > like the minimum number of points and the order of the points.
>
> > The code is checking if the polygon shape only has 1 part. If so it
> should
>
> > be clockwise.
>
> > After that, it is using the GEOS:IsValid method.
>
> > As I understand you correctly I should interpret this message as a
> warning,
>
> > not as an error.
>
>
>
> Different software, standard, formats have differen rules on if there must
> be a winding order and which one it is...
>
>
>
> A return of false by GEOS:IsValid() should be examined a bit more closely
> (but apparently you get this error before calling IsValid())
>
>
>
> >
>
> > I also tried your suggestion:
>
> > ogr2ogr -sql "select ST_ForceLHR(geometry) from ogr_clipped" -dialect
>
> > sqlite ogr_clipped_lhr.shp ogr_clipped.shp
>
>
>
> Jukka answered on the LHR vs RHR confusion, but I completely missed the
> fact that you were outputting to shapefile. In that case, whatever the
> original orientation, or if you modified it with a SQL statement, the OGR
> shapefile writer will force the polygons to follow the shapefile
> specification, which requires the outer ring to be in clockwise order. So
> you shouldn't get this error... Which means that either there's an issue in
> some case in the shapefile driver (numerical precision issue), or in the
> check in MapWinGIS.
>
>
>
> Even
>
>
>
> --
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171013/9b9a59b1/attachment.html>
More information about the gdal-dev
mailing list