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:
Solved! Go to Solution.
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.
Hi Levi,
Maybe try a negative buffer using a very small value and then perform the dissolve or merge?
-Scott
Sounds good. Could you elaborate? Thanks!
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.
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.
Ah, OK. Thanks!
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.
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?
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!