Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Using ArcGIS 10, I have a Feature Class which I converted from a Raster (GRID) (Raster To Polygon Tool).

  • There are approx. 180,000 polygons.
  • The attribute table contains a [grid_code] field which I need to preserve.
  • If one or more polygons are contiguous with corners touching AND they have the same [grid_code] value, then I'd like to group them (a dissolve basically) into one polygon (record).
  • Then I need to calculate the grouped polygon's area.

Using the Select By Location Tool, I'm able to successfully select the polygons that I need to group, but how do I then convert them into ONE polygon, while preserving the [grid_code] ?? Thanks.

share|improve this question
3  
Have you considered running the Region Group command before converting the rasters to polygons? –  Kirk Kuykendall Jan 17 '12 at 22:54
1  
Kirk is absolutely right: you want to do this calculation with the original grid, where it will be quick and efficient, rather than in the output vector format, where it will be slow and painful. –  whuber Jan 17 '12 at 23:12
2  
Thank you Kirk and Bill. Yes, Region Group is the right tool. Unfortunately, using Region Group on my large dataset causes horizontal striping, a known Spatial Analyst error. These stripes have been documented as early as Dec. 2009, but now, using ArcGIS 10, these problems STILL exist. You can read all about it here: [link]( forums.arcgis.com/threads/… ) My work around is to write the output from the Region Group tool to a good old fashioned ArcInfo Workspace as a GRID. That seems to fix it! –  mjn Jan 18 '12 at 21:20
    
Without that work-around, and given the RegionGroup bug, you would have to perform a 2x2 focal variety calculation to identify potential corners (the variety has to be 3 or 4) and then use those to create a table of potential corner-to-corner relationships among the polygons, which could (greatly) streamline the search for corner-touching polygons. What a pain... –  whuber Jan 19 '12 at 19:27
    
Keep in mind that if the polygons share only a single vertex, you introduce a self-intersection and thereby invalidate the geometry. –  Jim B Mar 30 '12 at 19:05
add comment

4 Answers

That is a lot of polygons. I would also find a solution in raster format first when the topology is easier to handle. But if you don't want to write code, you could :

  1. Select a given grid code.
  2. buffer that grid code by a very small amount (merged buffers option)
  3. buffer the result negatively by the same very small about.

There will be a slight rounding in the geometry.

To create a single layer, intersect the resulting grid code layers and clean to remove sliver polygons.

share|improve this answer
add comment

I would, personally, write code that looped through the polygons, and checked on the 4 corner coords of a polygon being the same as any other polygon corners and recursively call it - Flood fill as such.

I do this with netCDF grids to create appropriately similar polygons.

Another option would be to progamatically do this at root with the grid.

share|improve this answer
    
Comments have been purged when they have degraded into pointless bickering and / or noise, and the entire set is unsalvageable. –  Mapperz Jan 20 '12 at 16:33
add comment

You can dissolve contiguous polygons with common id values by using the Dissolve Tool.

  1. Select your Grid code field as your "Dissolve_Field (optional)"
  2. At the bottom of the tool form, check the "Unsplit lines (optional)" checkbox.
  3. Create area field
  4. Right click area field and select Calculate Geometry
share|improve this answer
add comment

You might consider using the ETGeoWizard toolset: http://www.ian-ko.com/ET_GeoWizards/gw_main.htm

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.