Select to view content in your preferred language

How To Turn A Grid Polygon Into Single Polygon

1675
8
Jump to solution
07-28-2020 03:53 PM
LeviCecil
Frequent Contributor

I have tessellated hexagon grid polygons that have multiple rows for each grid cell. I need to dissolve these into a single feature with all the grid lines intact that has the original grid cell count in a new field. When I try to dissolve, I just get the outline of the grids. I've tried adding a common ID field and dissolving on that, but no matter what, I get the outline. Is this possible with vector analysis? I'd like to avoid converting to raster if at all possible. I've encountered weird warping of lines when I try to go from polygon to raster and back again. 

Before:

After:

0 Kudos
1 Solution

Accepted Solutions
Scott_Harris
Esri Regular Contributor

Yep, David is right. That's what I meant. Sorry I didn't explain further. It seems like a small negative buffer would work:

Before:

After the buffer and zoomed in:

When merged or dissolved, they end as a single non-contiguous multipart feature, which is I think what you want. Just experiment with the parameters until you get what you want. 

View solution in original post

0 Kudos
8 Replies
Scott_Harris
Esri Regular Contributor

Hi Levi,

Maybe try a negative buffer using a very small value and then perform the dissolve or merge?

-Scott

0 Kudos
LeviCecil
Frequent Contributor

Sounds good. Could you elaborate? Thanks! 

0 Kudos
DavidPike
MVP Frequent Contributor

What Scott is saying is that contiguous features can't be multipart, you would have to make them non-contiguous by some method then merge them.  The negative buffer would work, but how it will cope with keeping them as hexagons I'm not sure.  I'm also not sure what delights a FLAT as opposed to ROUND negative buffer would produce.

Scott_Harris
Esri Regular Contributor

Yep, David is right. That's what I meant. Sorry I didn't explain further. It seems like a small negative buffer would work:

Before:

After the buffer and zoomed in:

When merged or dissolved, they end as a single non-contiguous multipart feature, which is I think what you want. Just experiment with the parameters until you get what you want. 

0 Kudos
LeviCecil
Frequent Contributor

Ah, OK. Thanks! 

0 Kudos
LeviCecil
Frequent Contributor

So this works perfectly when I run the tool manually in Pro, but when I export it as a python script from the geoprocessing history and run it, it outputs the dissolved outline. I've tried changing the parameters and it's still just making the outline:

arcpy.analysis.Buffer(fc, grid_buffer_dissolve, "-0.01 Feet", "", "", "NONE", None, "PLANAR")

I need to script this to dissolve thousands of these and append them to a single feature class. 

0 Kudos
RockyRudolph
Emerging Contributor

worked fine for me on the command line.  you sure you have the inputs set correctly for your fc and grid_buffer_dissolve variables?

Also, what are you trying to do?  Wouldn't it be easier just to use arcpy.management.GetCount(fc) to get a count of cells for each featureclass and just script that instead?  

0 Kudos
LeviCecil
Frequent Contributor

I am getting the count that way. I just figured out the issue. I still had a dissolve tool in my script right after the buffer tool that I forgot to delete. Facepalm. 

Thanks guys!

0 Kudos