2

I have a piece of python code written that works fine on a small test area but when I blow up the size of the test area I get a "tool is not licensed" error.

arcpy.CheckOutExtension("Spatial")
spatial_reference = arcpy.SpatialReference(Environment.srid)
arcpy.env.outputCoordinateSystem = spatial_reference
arcpy.env.overwriteOutput = True
arcpy.env.snapRaster = Environment.dem
process_boundary = Environment.boundary

boundary = Environment.output_location + '/background/boundary'
f_ = 'FID'
arcpy.PolygonToRaster_conversion(process_boundary, f_, Environment.scratch_workspace + '/boundary', cellsize='1')
ras = Int(((Raster(Environment.scratch_workspace + '/boundary') + 1) / (Raster(Environment.scratch_workspace + '/boundary') + 1)) - 1)
ras.save(boundary)

The polygon to raster works fine and produces the expected result. The scratch_workspace is a file geo-database.

Error:

File "G:\Code\models\background.py", line 30, in process
    ras = Int(((Raster(Environment.scratch_workspace + '/boundary') + 1) / (Raster(Environment.scratch_workspace + '/boundary') + 1)) - 1)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\Functions.py", line 4180, in Plus
    in_raster_or_constant2)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\Utils.py", line 53, in swapper
    result = wrapper(*args, **kwargs)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\Functions.py", line 4177, in Wrapper
    ["Plus", in_raster_or_constant1, in_raster_or_constant2])
RuntimeError: ERROR 000824: The tool is not licensed.

I have tried both Spatial and 3D for my defined license.

  • Could it be that the licence has a max size/area restriction ? (for exemple some tool of the free version of ET geowizard have a 100 or 300 feature limit) – J.R Sep 3 '19 at 16:23
  • 3
    Check the output of arcpy.CheckOutExtension("Spatial") to make sure one's actually available – mikewatt Sep 3 '19 at 17:02
  • 1
    The only tools I'm aware of that the input data changes the license level is Intersect. More than 2 inputs requires Adv. I've never heard of a tool fail a license check due to the area/extent of data. – KHibma Sep 3 '19 at 17:27
  • I always have a copy of ArcMap open with my license locked in the background when I am running python so that I don't loose the extension connection. Somehow, with this "safe-guard" in place, PyCharm did not have access to the extension. I restarted PyCharm and it is now working. Feeling dumb... – D_C Sep 3 '19 at 17:36
0

It's likely that you don't have the right license to scale. Quoting from the ESRI website: "Tools are licensed by product level (ArcGIS for Desktop Basic, Standard, or Advanced) and by extension (ArcGIS Network Analyst extension, ArcGIS Spatial Analyst extension, and so on). You can find what license levels are required on the tool's reference page. Functions are not licensed—they are installed with ArcPy."

https://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy/a-quick-tour-of-arcpy.htm

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.