Trouble with Extract By Mask

1663
1
Jump to solution
11-01-2017 09:39 AM
MohammadrezaNikfal1
Occasional Contributor

Hi,

I can clip a raster using  "Extract By Mask" in python window of ArcGIS as follow:

    a=arcpy.sa.ExtractByMask("out_raster1","StudyArea")

However, when I use the same code out of ArcGIS (i.e. PyCharm), I get this error:

      rcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
      ERROR 000824: The tool is not licensed.
      Failed to execute (ExtractByMask).

What is wrong?

0 Kudos
1 Solution

Accepted Solutions
MohammadrezaNikfal1
Occasional Contributor

Found the solution!

I had to Check Out Spatial Analysis after importing arcpy as follow:

import arcpy
arcpy.CheckOutExtension('Spatial')‍‍

Cheers

View solution in original post

0 Kudos
1 Reply
MohammadrezaNikfal1
Occasional Contributor

Found the solution!

I had to Check Out Spatial Analysis after importing arcpy as follow:

import arcpy
arcpy.CheckOutExtension('Spatial')‍‍

Cheers

0 Kudos