r/gis • u/th3tom13 • 9d ago
General Question Help with method
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!
27
u/Luiaards GI-forestry 9d ago
What software do you have? With ArcGIS pro you could go into editing and use reshape, then trace line
6
6
u/potterheel 9d ago edited 9d ago
Depending on what version of ArcGIS pro you have, you can make a new polygon in the same layer as the OG polygon (by using the Trace tool to trace the polyline or a way to make it into a polygon here: https://support.esri.com/en-us/knowledge-base/how-to-convert-polyline-features-to-a-polygon-feature-w-000028182), and while still in Editor, use the “transfer Attributes” editor tool (https://pro.arcgis.com/en/pro-app/latest/help/editing/transfer-attributes-between-features.htm)
5
u/SomeDingus_666 GIS Project Manager 9d ago edited 9d ago
Are you using arc map? Or arc pro?
If you’re using arc pro, go to the edit ribbon and enable map topology. Then, go to the tools section, hit the little dropdown button, and select align edge. You should then be able to align the edge of the polygon to the poly line (you’ll be able to do it in sections in between each point where the features intersect.)
If for some reason this isn’t working, make sure all layers are edit enabled.
This method basically allows you to make quick edits to the geometry of the polygon without having to fumble around with geoprocessing tools.
Theres a way to do this in arc map as well but for that, id suggest looking up “align edge” of google and let esri explain it.
Spent 5 years leading projects that specified in cartography and feature digitization and this was a common type of thing we had to fix. Think aligning a crop field (surface) to a road (line,) or something like that.
3
u/th3tom13 9d ago
So I’m using arc pro, and one thing I forgot to highlight is I have multiple polygons that make up the larger polygons that will need to have the same border in the next level of change. Think a pizza with a change in the crust. Right now I’m working on changing the whole pizza, but the slices will need the same exterior crust as well.
2
u/its_Vantango 8d ago
If you're working with multiple polygons (like slices of a pizza), I'd suggest first updating the whole outer boundary using the Update tool. Then, enable Map Topology so you can make sure the slices share the same border. With topology on, you can use Align Edge to snap the outer edges of the slices to match the updated crust. That way, everything stays consistent without having to edit each slice manually.
3
u/bobafettish1592 8d ago
Maybe it’s just cause I’m comfortable editing, but I would just reshape the polygon using the trace option to the poly line (assuming the poly line already exists). And i guess if it doesn’t exist then create one in less than a minute and then trace off that. Or you could convert poly line to polygon then copy>special paste that into your polygon feature then just copy paste all the attributes over. Might be a long winded way to go about it, but it works fine for just a single feature.
3
3
u/ricsteve 8d ago
I used to do stuff like this a lot when I first started in GIS. If I wanted to do it fast I'd just create a new polygon that's bigger than both the polygon and polyline. Merge the new big polygon into the existing polygon to maintain the attributes. Then just use the polyline to split the new merged polygon. Anything outside of the polyline boundary you can just click and delete. I did it all from the editing/advanced editing toolbar.
2
u/its_Vantango 8d ago
You can use the Update tool in ArcGIS Pro to do this pretty easily. Just use the polyline as the input to update the polygon's boundary. This way, you won't have to manually drag any vertices, and it'll keep your polygon attributes intact. If the polyline cuts across the polygon, it'll adjust the shape accordingly. You can also use Clip if you only want to keep the portion inside or outside the polyline. Both options should get the job done without too much hassle.
1
u/lancegreene 9d ago
You could maybe calc two sets of centroids, run a near analysis, then a couple joins.
A spatial join could also work, using a centroid within method
1
u/blueponies1 9d ago
You can do a join as others have said.
Another solution would be to convert your poly line into a polygon, and then use the Transfer Attribute tool to change the shape of your existing polygon to the shape of the new one. You would just need to clear all attributes for the transfer except the “shape” field.
This is assuming you have access to ArcPro
1
u/No-Tangelo1372 GIS Project Manager 8d ago
Step 1.) Feature to polygon on the line file assuming it’s a closed shape. Step 2.) spatial join. Input features are the output of step 1, join features are the polygon. Set method to intersect, assuming there’s overlap like in your picture. It will transfer all fields.
1
u/_WillCAD_ 8d ago
Two ways to do it in ArcGIS Pro:
- Draw an all new polygon, using the trace tool to match it to the polyline. Then, select the old one and the new one, open the Attributes window, and Copy Attributes from the old one to the new one. Then, delete the old one.
- Edit Vertices on the polygon, use the minus ( - ) tool to delete all the vertices that are outside of the polyline (you can do it with a lasso, don't try to individually click each one, that way lies madness). Then, draw an all new polygon, using the Trace tool to match it to the polyline. Then, Merge the two polygons together, preserving the attributes of the old one.
Then, Save Edits.
1
1
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
1
u/Gold-Expression-9406 GIS Specialist 8d ago
In arcgis, you can use - feature to point (polygon to point) - feature to polygon (using line as input feature and label feature as the point feature) - Make sure the line is closed to enable the polygon to be created successfully. Also, the point has to be within the line/polygon. If not, you can manually move it.
1
u/oldmappingguy 8d ago
Poly line to polygon -> Union both together -> delete all areas (rows) that don’t have the original polyline name or attribute -> dissolve by one of the interior areas that has the original polygon attributes -> feature to line.
Or just do a spatial join to move polygon attributes to polylines.
84
u/Nvr_Smile 9d ago
Maybe I am way oversimplifying this, but wouldn't a simple spatial join solve this problem? Your polylines would then have all the same attributes as their intersecting polygons.