Quantcast
Channel: Forums - Geoprocessing
Viewing all articles
Browse latest Browse all 1952

ExtractMultiValuesToPoints crashes Python

$
0
0
Hello,

Here is a follow-up from another question:
http://forums.arcgis.com/threads/918...es-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:

Code:

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/questio...crashes-python

Viewing all articles
Browse latest Browse all 1952

Trending Articles