2

There are 102 raster files in total that I want to convert to points. Each raster file is 2160x4320 pixels. When running the script in the code block below, the process hangs into the third or fourth raster file, regardless of if I take a random sample of the 102 rasters to start with. Even taking a subset of six of these rasters and converting them to points leads my machine to hang on the third raster file.

The first two rasters both take around 10 minutes to convert, and the third raster file was processing for 10 hours before I stopped it. While the third raster file was being processed, I noticed that ArcMap's associated RuntimeLocalServer.exe private memory allocation for RAM grew from ~900mb after completing the first two and starting on the third to ~2600mb once I stopped the process.

Regarding the machine I'm using - I'm using ArcGIS 10.5 on a computer with a i7-6700K processor, 32GB ram, and a terabyte SSD. The computer is good working order in terms of software and hardware.

When run on a desktop a few years older with only 16GB of RAM, the same script below has crashed ArcGIS and left the routine incomplete after about three files are processed. It seems like ArcGIS isn't clearing VRAM or RAM used for already-converted raster files, but I have no idea if this is actually the problem.

Is there some ArcPy memory management command that I can include in my code below? Why is this process consistently failing to finish?

# Convert all rasters in a directory to points.

import arcpy
import os

conversionList = []

for root, dirs, files in os.walk(r"D:/data/crops/earthstat/HarvestedAreaYieldMajorCrops_Geotiff/"):
    for f in files:
        if f.endswith(".tif"):
            fpath = root + "/"+  f
            conversionList.append(fpath)

outputPath = r"D:/data/crops/earthstat/HarvestedAreaYieldMajorCrops_Points/"

for item in conversionList:
    infile = str(item)
    outfile = outputPath + item.split("/")[-1].split(".")[0] + ".shp"
    arcpy.RasterToPoint_conversion(infile, outfile, "Value")

closed as off-topic by PolyGeo Mar 10 '17 at 7:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Are you running this script from within ArcGIS or using standalone Python? – AHigh Feb 20 '17 at 20:14
  • I have used the standalone Python script above as well as putting the same script into ArcMap's Python window. Results are the same. – lenny_leonard Feb 21 '17 at 3:59
  • Try converting to feature classes in a file geodatabase instead of shapefiles – BERA Feb 21 '17 at 6:58
  • I have no idea what is happening behind the scenes in terms of memory consumption for this particular GP tool, but a couple of things to try: 1. Shapefile .dbf can only be 2GB in size which may cause troubles when exporting a large raster. So, export to file gdb. 2. Install Background processing for 64bit Python as this will let you exploit those ~14GB RAM available on the 16GB machine. – Alex Tereshenkov Feb 21 '17 at 7:00
  • Thanks BERA and Alex Tereshenkov. I will try what you suggest and report back. – lenny_leonard Feb 21 '17 at 15:59