Re: [gdal-dev] Algorithm to clip the inner loop of a polygon

2020-04-15 Thread Andreas Oxenstierna
Hi I see that I forgot to create polygons from the splitted lines Sp the syntax should be something like: ST_ExteriorRing((ST_Dump(ST_Polygonize(ST_LineMerge(ST_Union(ST_Force2D(geometry>)).geom) Hi Ari and Andreas, Thanks for the information. I will check it out. Today I advanced a lit

Re: [gdal-dev] Algorithm to clip the inner loop of a polygon

2020-04-15 Thread Chao YUE
Hi Ari and Andreas, Thanks for the information. I will check it out. Today I advanced a little by almost implementing what's been proposed in my message there. Regards, Chao On Wed, Apr 15, 2020 at 3:04 PM Ari Jolma wrote: > Andreas Oxenstierna kirjoitti 15.4.2020 klo 9.03: > > Hi > > Have you

Re: [gdal-dev] Algorithm to clip the inner loop of a polygon

2020-04-15 Thread Ari Jolma
Andreas Oxenstierna kirjoitti 15.4.2020 klo 9.03: Hi Have you tested PostGIS? ST_ExteriorRing((ST_Dump(ST_LineMerge(ST_Union(ST_Force2D(geometry>).geom) should extract the points you want to keep by splitting at intersections - but it may fail in very complex cases. Then I would start wi

Re: [gdal-dev] Algorithm to clip the inner loop of a polygon

2020-04-14 Thread Andreas Oxenstierna
Hi Have you tested PostGIS? ST_ExteriorRing((ST_Dump(ST_LineMerge(ST_Union(ST_Force2D(geometry>).geom) should extract the points you want to keep by splitting at intersections - but it may fail in very complex cases. Then I would start with a ST_SnapToGrid with a quite high tolerance to l

Re: [gdal-dev] Algorithm to clip the inner loop of a polygon

2020-04-14 Thread Ari Jolma
Hi, I wrote a method to a Polygon class (in Python) that solves that problem because the ones in GEOS via Shapely did not seem good enough. My method was based on no published algorithm but just my own reasoning, it is probably not optimal speed-wise. I did not perform formal testing on it bu

[gdal-dev] Algorithm to clip the inner loop of a polygon

2020-04-14 Thread Chao YUE
Dear all, Does anyone have some experience or is aware of some algorithm that can find and clip the inner loop formed in a polygon ? I attach one example here. In this case I would only keep the outer points and drop the ones that make an inner loop. I am developing some algorithm to simulate wild