Export Raster Data (by extent of dataframe) - how to automate?

422
4
01-12-2012 08:10 AM
DanielJones6
New Contributor
I have a 1m NAIP of the state of California (437GB) in Mr. Sid format that is Read-Only in its native state.  I only want a portion of Northern Cali but to do any sort of geoprocessing on the file I must export the file in chunks - right click on the layer ->Data->Export->so on...  I want to loop the process using PLSS sections
>>>for sec in sections:  Does anyone know how to code for the right click process as the raster clip tool won't work for this situation???

Thank you for your time,
Frustrated GIS Tech.
Tags (2)
0 Kudos
4 Replies
curtvprice
MVP Esteemed Contributor
I think the easiest approach would be to use model builder instead of Python:

  1. Use the Iterate Features with your PLSS sections polygon feature class as input

  2. On each iteration, use CopyFeatures_management to the feature class to a intermediate polygon  feature class(say, "in_memory\clip_poly")

  3. Connect the temporary polygon and the input raster to the Clip_management tool as input parameters.

  4. Connect the temporary polygon to the tool for environment extent, and connect the input raster to set the environment for  snap raster and cell size.

  5. Set the output path of the Clip_management tool be something like "raster%Name%.jpg", this will uniquely name the outputs with the field iterator value. (Make sure the field you're iterating on on is nice and short, starts with a letter, and only includes characters: a-z,0-9,_)

0 Kudos
DanielJones6
New Contributor
Thanks for your input,

The problem is that I cannot do any sort of geoprocessing (Clip_management) on the raster.  It is Read-Only in its native state.  What I am actually viewing is a layer file pointing to the data that is housed in a server in New Mexico and the file is too large (437GB) to export in order to "make it my own".
0 Kudos
curtvprice
MVP Esteemed Contributor
Thanks for your input,

The problem is that I cannot do any sort of geoprocessing (Clip_management) on the raster.  It is Read-Only in its native state.  What I am actually viewing is a layer file pointing to the data that is housed in a server in New Mexico and the file is too large (437GB) to export in order to "make it my own".


Hmm I would think setting the environment extent first would only pull across the part the raster you'd need. Have you tried that? If Clip_management doesn't work you may want to try CopyRaster_management - it isn't a spatial analyst tool so it may work better with a your raster web service. The doc for Copy_Raster says it honors the extent and snap raster environment.
0 Kudos
DanielJones6
New Contributor
Mr. Curtvprice,

Thanks for your tip: CopyRaster_management!!!  I had a colleague try the tool out and it works on the Read-Only layer file.  I haven't looped the process yet, but manipulation was the major setback. 

Thank you for your time,
Frustrated GIS Tech.
0 Kudos