0

Not sure if it is an error on my part, or Esri. I am just running a model in ModelBuilder that incorporates the weights for four of the parameters in the raster calculation. It seems to run find before I add four variant variables that use weights.

This is the equation I am putting in my raster calculator before I select 'Run':

%FHHChldWeight% * “%FHHChldDensity%” + %NoHighSchWeight% * “%NoHighSchDensity%” +
%MaleUnemWeight% * “%MaleUnemDensity%” + %PovertyWeight% * “%PovertyDensity%”

my raster calculation code (what gets calculated in the end) It seems its not calculating my first parameter ChildWeightr:

25*"FHHChldDensity"+"25" *"NoHighSchDensity" + "25"* "MaleUnemDensity" +"25" *PovertyDensity

but here is my traceback:

Executing (FHH Kernel): KernelDensity PittsburghBlkGrps ZFHHChld E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\FHHChldDensity 50 3000 "Square miles" Densities Planar #
Start Time: Friday, November 25, 2022 1:09:38 PM
Succeeded at Friday, November 25, 2022 1:09:51 PM (Elapsed Time: 12.93 seconds)
Executing (NoHighSch Kernel Density): KernelDensity PittsburghBlkGrps ZNoHighSch E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\NoHighSchDensity 50 3000 "Square miles" Densities Planar #
Start Time: Friday, November 25, 2022 1:09:52 PM
Succeeded at Friday, November 25, 2022 1:10:05 PM (Elapsed Time: 12.73 seconds)
Executing (MaleUnem Kernel Density): KernelDensity PittsburghBlkGrps ZMaleUnem E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\MaleUnemDensity 50 3000 "Square miles" Densities Planar #
Start Time: Friday, November 25, 2022 1:10:05 PM
Succeeded at Friday, November 25, 2022 1:10:18 PM (Elapsed Time: 12.77 seconds)
Executing (Kernel Density (4)): KernelDensity PittsburghBlkGrps ZPoverty E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\PovertyDensity 50 3000 "Square miles" Densities Planar #
Start Time: Friday, November 25, 2022 1:10:19 PM
Succeeded at Friday, November 25, 2022 1:10:31 PM (Elapsed Time: 12.74 seconds)
Executing (Raster Calculator): RasterCalculator "25* "E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\FHHChldDensity" +"25" * "E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\NoHighSchDensity" + "25"* "E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\MaleUnemDensity" +"25" * "E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\PovertyDensity"" e:\downloads\gistforpro1\esripress\gistforpro\chapter10\tutorials\chapter10.gdb\poverty_index
Start Time: Friday, November 25, 2022 1:10:34 PM
25* Raster(r"E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\FHHChldDensity") +"25" * Raster(r"E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\NoHighSchDensity") + "25"* Raster(r"E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\MaleUnemDensity") +"25" * Raster(r"E:\Downloads\GISTforPro1\EsriPress\GISTforPro\Chapter10\Tutorials\Chapter10.gdb\PovertyDensity")
ERROR 000539: Traceback (most recent call last):
  File "<expression>", line 1, in <module>
  File "<string>", line 5, in rcexec_DC684390_0C54_4F14_9EBF_B34DF3F2E1B1
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 9342, in Times
    return Wrapper(
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Utils.py", line 55, in swapper
    result = wrapper(*args, **kwargs)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 9340, in Wrapper
    return _wrapLocalFunctionRaster(u"Times_sa",
RuntimeError: ERROR 000732: Input Raster: Dataset 25 does not exist or is not supported

Failed to execute (Raster Calculator).
Failed at Friday, November 25, 2022 1:10:36 PM (Elapsed Time: 1.11 seconds)

Not sure how to work around this, or why it's doing this or why I am getting this error.

3
  • Yeah that didn't work either, got an 9999 error when I tried to use double.
    – pixidust
    Nov 27, 2022 at 0:18
  • Can you make sure that the variable is represented correctly - %FHHChldWeight%. It is not finding the dataset, but if you look through the stack the value is never in quotes as the others are. The error refers to not being able to access a dataset. But could also point to a wrong variable.
    – enolan
    Dec 5, 2022 at 19:12

1 Answer 1

0

In the model, set your weight parameters as a numeric type, either floating point (double type) or integer (long type).

In the raster calculator, cast your weights to numeric using

float("%weight param%")

or

int("%weight param%")

E.g.

enter image description here

enter image description here

enter image description here

1
  • @pixidust Did this answer solve your issue? If it did, you may choose to accept to mark the question as answered. Or if not, please provide feedback so the answer can be improved and help you or future users with the same problem.
    – user2856
    Jan 9 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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