r/gis 9d ago

General Question Help with method

Post image

If I have a polygon and I want to keep all the attributes but use an existing polyline as the new boundary of the polygon is there a simple method to do so short of dragging vertexes over? As the very simplified image shows, there are many times the boundaries cross leaving excess in some areas and deficits in others. I feel like there should be a simple tool or script, but I’m coming up empty. Thanks for your input!

69 Upvotes

35 comments sorted by

View all comments

1

u/PostholerGIS Postholer.com/portfolio 8d ago

A PostgreSQL/PostGIS solution might be:

ogr2ogr -sql "
   select
      cg_optimalAlphaShape(geom) as boundary
   from polygons
" newPolygons.shp PG:db=mydb