Re: [gdal-dev] Clipping shapefile with another produces invalid shapes

2017-10-13 Thread Paul Meems
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

Re: [gdal-dev] Clipping shapefile with another produces invalid shapes

2017-10-13 Thread Even Rouault
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 poin

Re: [gdal-dev] Clipping shapefile with another produces invalid shapes

2017-10-13 Thread jratike80
Even Rouault-2 wrote > You could possibly use the ST_ForceLHR() function of spatialite (through > the SQL SQLite > dialect) to post process your result: > http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.0.html Interesting, that ST_ForceLHR in Spatialite gives the same result than ST_ForceRHR

Re: [gdal-dev] Clipping shapefile with another produces invalid shapes

2017-10-13 Thread Paul Meems
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 shap

Re: [gdal-dev] Clipping shapefile with another produces invalid shapes

2017-10-12 Thread Even Rouault
Paul, > But at the red asterix, I have an invalid shape. The reason is according to > GEOS: > Polygon must be clockwise I can't see such error emitted by GEOS source code. even@even-i700:~$ grep -r "must be clockwise" geos/ even@even-i700:~$ Are you sure this comes from it ? As far as I know,

[gdal-dev] Clipping shapefile with another produces invalid shapes

2017-10-12 Thread Paul Meems
Hi list, I have a very large shapefile, with almost 700k shapes which I want to clip with a border shapefile (in red): https://ibb.co/gKth1G I'm using this command: ogr2ogr -clipsrc "border.shp" -overwrite -explodecollections -f "ESRI Shapefile" ogr_clipped.shp Fishnet.shp with GDAL 2.1.3, relea