Script tool works in folder but not in P.Geodatabase

1618
3
Jump to solution
02-01-2016 06:51 AM
KONPETROV
Occasional Contributor III

Hello I have written a script that runs excellent at a folder but when I try it at a Geodatabase it crashes, due to the reason that it has to run a reclassification of two classes my values are 0 and 1 I checked it, and it keeps showing me a message ERROR 045037. Raster has values outside range [0;1] . Why is that happening?

This is the code for reclass

# This function takes the maximum and minimum value of DEM
demMAXResult = arcpy.GetRasterProperties_management(demodel, "MAXIMUM")
demMINResult = arcpy.GetRasterProperties_management(demodel, "MINIMUM")
demMAX = demMAXResult.getOutput(0)
demMIN = demMINResult.getOutput(0)
LIMIT = float(demMAX) - height



outReclass = Reclassify(demodel, "Value", RemapRange([[float(demMIN),LIMIT,0],[LIMIT,demMAX,1]]), "NODATA")
outReclass.save(os.path.join(env.workspace, "rcls"))

And this is the part of the code that crashes when uses the reclassified raster

arcpy.CreateSpatiallyBalancedPoints_ga(os.path.join(env.workspace, "rcls"), 1, os.path.join(env.workspace, "point" + str(n)))

Any help? Thanks

0 Kudos
1 Solution

Accepted Solutions
AdrianWelsh
MVP Honored Contributor

If this runs excellent within a folder and not in a personal geodatabase, have you tried a file geodatabase? Is it possible that your geodatabase is locked (have you tried restarting your PC and trying again)?

View solution in original post

3 Replies
AdrianWelsh
MVP Honored Contributor

If this runs excellent within a folder and not in a personal geodatabase, have you tried a file geodatabase? Is it possible that your geodatabase is locked (have you tried restarting your PC and trying again)?

KONPETROV
Occasional Contributor III

For God it worked. How did you know that with the File? What's the difference?

0 Kudos
AdrianWelsh
MVP Honored Contributor

Good question. I am sure there is an actual answer out there but I honestly do not know. I just know that it is usually better to use the file geodatabase versus the personal geodatabase these days. Just a good rule of thumb.

I am glad it is working for you!

0 Kudos