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.

Please refer to the attached image. The overlay on the map shows a raster file with disconnected circles. I want to split each of those circles into independent rasters in one shot. Is that even possible? If yes how? If not whats the fastest way to do it (avoiding as much donkey work as possible)?

enter image description here

share|improve this question
    
The circles don't look disconnected to me, especially near downtown. Is a web service generating the image that has the circles? If so, what sort of web service? –  Kirk Kuykendall Aug 30 '11 at 16:09
    
@Krik, The circles which are connected are one entity and need to go into one file. Is being rendered by WMS hosted on Geoserver. The Raster is Lidar Data. –  Shaunak Aug 30 '11 at 16:55
add comment

1 Answer

up vote 3 down vote accepted

At a minimum you will need to identify each connected component, find its extent, clip to that extent and export it. The clip/export process has to be in a loop: it won't happen as a single operation. But that's straightforward to script. Let's therefore focus on getting to that point where you have a list of extents to clip and export.

Identify the connected components with a RegionGroup operation on an indicator grid. (A quick way to obtain an indicator grid is to equate the raster with itself: it will have just 1's and NoData values.) Using the regiongroup output grid as zones, compute zonal maxima and minima of the two coordinate grids (one for X and the other for Y). (How you obtain the coordinate grid depends on which version of ArcGIS you are using. Pre-10.0, $$XMap and $$YMap did the trick.) This produces a rectangular extent ((xmin, ymin), (xmax, ymax)) for each of the regions, but the extent only goes as far as the most extreme cell centers. Expand these extents symmetrically by one-half the cellsize to enclose all the cells, becoming ((xmin-cellsize/2, ymin-cellsize/2), (xmax+cellsize/2, ymax+cellsize/2)). Now you're ready for the clip/export loop.

Regardless of how many connected components the raster has, this workflow obtains the list of their extents in just six grid operations (a comparison to create the indicator, a regiongroup, two zonal mins, and two zonal maxes).

For a really clean job, at each step in the clip/export loop you can use the current region to mask the clip output to the region itself. This will avoid having bits and pieces of other regions appearing wherever they intrude into the current extent.

share|improve this answer
    
Thanks! Let me try that out and get back. –  Shaunak Aug 30 '11 at 19:14
    
what do you mean by " equate the raster with itself", how do i do that? Sorry , I am fairly new to ArcGIS and Rasters. –  Shaunak Aug 30 '11 at 19:16
    
@Shaunak See webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=== . An example of its use is [Myraster] == [Myraster]. –  whuber Aug 30 '11 at 19:35
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.