Merge single linear feature with multiple polygons

1442
5
04-21-2021 03:18 PM
BenPearse
New Contributor III

Hello, 

The picture below is a single polygon. One of the polygons within this layer is a road (highlighted in blue) which runs through the middle of other polygons within that layer. I want the road polygon to be merged with the adjacent polygons, or alternatively, deleted, and the gap where the road was to be filled with the adjacent polygons.

It would be simple to do manually, but there are hundreds of polygons impacted and I'm wondering if there is a better way to do this. 

Thanks, 

Ben

BenPearse_0-1619042887925.png

 

0 Kudos
5 Replies
MehdiPira1
Esri Contributor

Hi @BenPearse ,

You can use Union in ArcGIS Pro or ArcMap.

Analysis Tools > Overlay > Union

https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/union.htm

then use Select (from Analysis Tools > Extract) or do a definition query on the output to filter out road.

0 Kudos
by Anonymous User
Not applicable

Hi Ben:

Can you clarify if your road polygons *overlap* the other polygons, or if all polygons in this dataset have disjoint (not intersecting) interiors?

 

If the road polygons overlap the other polygons, then I agree that Union is a solution. However, if all polygon interiors are disjoint, then this will not work.

 

I don't have a good answer for how to achieve a solution in the latter case using strictly esri-supplied vector operations.

But I know how to do it using esri operations on rasters. 😁

In that case, if the coordinates of your polygon vertices are not too sacred, you can rasterize your polygons at a suitable resolution, assign NODATA to the road polygon, then use Euclidean Allocation or Distance Allocation tools to 'spread' neighboring polygon IDs into the NODATA cells.

 

I can elaborate on this if you think this approach is worth pursuing.

 

Regards,

Jim TenBrink

spatial analyst team

esri

BenPearse
New Contributor III

Hi Jim, 

No my road polygons don't overlap so the union wouldn't work. 

The coordinates of my vertices are not sacred, although I would need to convert them back to polygons that are fairly similar to my original vector layer. 

I would definitely be interested in hearing your approach, the only caveat is that I don't currently have the spatial analyst extension. I'm pushing my supervisor to get it though, so maybe this could add to my argument for it.

Cheers, 

Ben

0 Kudos
by Anonymous User
Not applicable

Hi Ben:

Here's one approach.

1.Select all roads from your input polygons.

2. reverse the selection (so only non-road polygons are selected)

3. execute polygon to raster gp tool, using an attribute that uniquely identifies each non-road polygon as the 'value_field' parameter. We'll call this output raster "PolyR". Here's an example of what "PolyR" might look like (the white is nodata):

JimTenbrink_0-1619059541350.png

4. use that as the input to the Euclidean Allocation tool. 

5. The output should look something like this. We'll call this 'ErasedRoadsR":

JimTenbrink_1-1619059800805.png

6. In ErasedRoadsR, the cell values from PolyR have been 'spread' to the nearest NODATA cells.

Here are "PolyR" and "EraseRoadsR" shown together, using transparency for the latter. in EraseRoadsR each NODATA cell from POlyR is assigned the value of its closest DATA neighbor, thus 'filling in' the NODATA gaps.

JimTenbrink_2-1619059900261.png

 

 7. Finally, you can use the RasterToPolygon GP tool to convert back to a polygon feature class. You can use the 'Simply' parameter to get rid of the jaggies.

 

Hope this helps,

-jt

by Anonymous User
Not applicable

Hi Ben:

A colleague recommended the Eliminate GP tool, which might be an option. 

Can you post a representative sample of your dataset ? (please make sure its anonymized so that no personal information is present in the attributes). There might be a way to avoid altering polygon coordinates outside of the road area, but I'd like to test that first.

-jt

0 Kudos