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.

I've been trying to clip a larger raster dataset by a polygon extent, where the resulting clipped raster dataset is saved in-memory. So far, my attempts produce vague errors.

>>> arcpy.Clip_management(in_raster="/path/to/raster_dataset.tif", rectangle="899329.78438381 1065232.74648145 912509.334774774 1080416.77223298", out_raster="in_memory/clipped", in_template_dataset="/path/to/boundary.shp", clipping_geometry="ClippingGeometry")
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function. Failed to execute (Clip).

Is there a way I can store a raster dataset in-memory?

Documentation for the VB.NET API seem to indicate it is possible beginning in Arc 9.2, and I'm using Arc 10 on my workstation.

ArcGIS 9.2 allows to create an in-memory RasterDataset where the pixels are stored in memory, this type of raster dataset has the charastics of a file RasterDataset.

share|improve this question

2 Answers 2

This works for me:

arcpy.Clip_management("C12.TIF","481919 5456830 482895 5456851","in_memory/raster2","#","256","NONE")

When I first tried this, I just wrote right into the python window, I got an error. So I ran the GUI tool, and copy/pasted the 'python snippet' from that, it worked. I also tried just 'in_memory', this writes a raster named 'in_memory' to the default GDB.

share|improve this answer

I did a lot of raster processing about 2 years ago and to speed up the processing I wrote the grids (which were temporary and fairly small) to a RAM drive. Just do a search for ram drive and your operating system, you will find lots of information on how to set one up.

Once you've set it up and given it a drive letter lets say Z:\ then your output path would be "Z:\clipped" in your clip tool.

Duncan

share|improve this answer

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.