1

I am kind of new at this.

I ran a gis operation using python, where by I performed euclidean distance for specific state road, river and towns data and reclassified them showing good and bad areas and it worked.

However when I try to run batch processing for two state fils in the same folder, it runs but no output. any ideas how i can batch process vector files before reclassifying the raster output

import arcpy
from arcpy import env   
from arcpy.sa import * 
import os

# Check out the ArcGIS Spatial Analyst extension license
if arcpy.CheckExtension("Spatial") == "Available":
   arcpy.CheckOutExtension("Spatial")
else:
 # raise a custom exception
    raise LicenseError


if arcpy.CheckExtension("3D") == "Available":
   arcpy.CheckOutExtension("3D")
else:
 # raise a custom exception
   raise LicenseError
if arcpy.CheckExtension("Spatial") == "Available":
    arcpy.CheckOutExtension("Spatial")
else:
 # raise a custom exception
   raise LicenseError


if arcpy.CheckExtension("3D") == "Available":
    arcpy.CheckOutExtension("3D")
else:
 # raise a custom exception
    raise LicenseError 

env.workspace = "D:\\states\\ritchie"
root_folder = "D:\\states\\ritchie"
env.overwriteOutput=1

river = "C:\\states\\ritchie\\river\\"
try:
    fcs = arcpy.ListFeatureClasses()
    for fc in fcs:
        outEucDistance = EucDistance(os.path.join(river,fc), 2000, 50)
        outEucDistance.save("D:\\states\\ritchie\\river\\")
except:
print arcpy.GetMessages()
  • hi, am not trying to get an output for one file(state), but i want to get for 2 files in the river folder at the same time. and i have just specified output.save to the river folder on my end, still no result. any ideas please – rachel May 13 at 6:26
  • Are you sure "2 kilometers" is correct? That is shouldnt be "2 Kilometers", or 2000? If you remove the try/except you will get error messages telling you stuff like this. – BERA May 13 at 6:48
  • still no result or error message – rachel May 13 at 6:52
  • ok i will do that now – rachel May 13 at 6:59
  • You are not getting any errors becuase you are still using try/except, dont… This outEucDistance.save("D:\\states\\ritchie\\river\\") does not look like a valid output. Try outEucDistance.save("D:\\states\\ritchie\\river\\somerastername") – BERA May 13 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.