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()
"2 kilometers"
is correct? That is shouldnt be"2 Kilometers"
, or2000
? If you remove thetry/except
you will get error messages telling you stuff like this. – BERA May 13 '20 at 6:48try/except
, dont… ThisoutEucDistance.save("D:\\states\\ritchie\\river\\")
does not look like a valid output. TryoutEucDistance.save("D:\\states\\ritchie\\river\\somerastername")
– BERA May 13 '20 at 7:09