Select to view content in your preferred language

ExtractMultiValuesToPoints crashes Python

348
1
09-11-2013 12:58 AM
Joffreybaratheon
Emerging Contributor
Hello,

Here is a follow-up from another question:
http://forums.arcgis.com/threads/91812-Extract-Multi-Values-to-Points-correct-values-in-GUI-incorrec...

As a workaround, I first created a python list with strings pointing to individual raster bands ("raster1.tif/Band_1", "raster1.tif/Band_2", "raster1.tif/Band_3",etc).
Then I used it in this small script:

def raster_overlay(input_files):
    for raster in input_files:
        ExtractMultiValuesToPoints(in_shp, raster, "BILINEAR")

in_shp = "temp/shapefiles/points.shp"
raster_overlay(raster_files)


The shapefile contains around 50 points, and each raster is around 15MB.

If the list of rasters is small (more or less <20), everything works as expected. However, I have around 50 raster images. Using the complete list, Python crashes ("python.exe has stopped working") after processing 21 images or so.

The values of the first 20 rasters are correctly appended to the shapefile (one column for each raster).

I monitored python.exe in the Windows 7 Resource Monitor. Memory usage of Python starts around 15 MB and then gradually increases to around 700 MB (and then Python crashes). So, memory leakage might be the reason for the crashes (although the PC has 8 GB of RAM).

Is this a known bug?
Is there a workaround?

By the way, I posted the same question earlier here:
http://gis.stackexchange.com/questions/71104/small-script-crashes-python
0 Kudos
1 Reply
curtvprice
MVP Esteemed Contributor
Is there a workaround?


I think you found one workaround already - don't try to process more than 20 bands at once.

Another workaround you could may want to try is the Sample tool.
0 Kudos