Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

How to access Spatial Analyst extension from stand alone script?

$
0
0

If I run this script:

import arcpy
arcpy.AddMessage(arcpy.CheckExtension("Spatial"))
from arcpy.sa import Con
from arcpy import env
fDir=r'd:scratchfdir'
outFolder=r'd:aerialsimages'
env.workspace = outFolder
fDir=arcpy.Raster(fDir)
Gter=Con(fDir> 1,2)
Gter.save("TEST")

from ArcGIS, the output is:

enter image description here

When I run it as stand-alone script, it is very different story:

enter image description here

QUESTION:

How to access Spatial Analyst extension from stand alone script?


Viewing all articles
Browse latest Browse all 767

Trending Articles