joffrey_baratheon

ExtractMultiValuesToPoints crashes Python

Discussion created by joffrey_baratheon on Sep 11, 2013
Latest reply on Sep 11, 2013 by curtvprice
Hello,

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

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

Outcomes