2

I have imported points objects from dxf/dwg (exported from Inkscape) in QGis and although the stroke was set on 0, I get for each point 3 shapes made of lines. When I polygonize them with Postgis I get of course 3 shapes as well for each point : 1 "big" polygon and 2 others that are only borders around it. enter image description here

So I would like to select for each case only 1 polygon and delete the others. I have thinked of using st_centroid and keep only 1 of 3 by deleting duplicate geometries but the centroids don't overlap since the polygons don't have exactly the same extent. How could I achieve this ?

4
  • 1
    Do they share a common identifier?
    – geozelot
    Commented May 3, 2023 at 9:49
  • Unfortunately, no...
    – Arn
    Commented May 3, 2023 at 11:59
  • 1
    I finally selected the good polygons by using st_area and picking the largest. But it would be very useful to have a "universal method" only based on intersecting shapes.
    – Arn
    Commented May 3, 2023 at 12:02
  • 1
    What about to select polygons with no holes? postgis.net/docs/ST_NumInteriorRings.html
    – DavidP
    Commented May 30, 2023 at 11:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.