Rescaling an image with a factor from 0 to 1 does not work (arcpy.Rescale_management)

479
2
Jump to solution
06-08-2020 04:19 AM
MoritzWollen
New Contributor II

Hey,
I am using ArcGIS Pro 2.5.1 and try to scale the CellSize of an image from 1 to a value of ~0.48 using arcpy.Rescale_management.

The Rescale - Data Management Tool in ArcGIS Pro works correctly for this use case

When trying to use the rescaling function in Python I get the following exception

If I export the function called in ArcGIS Pro as a Python script, the exact same function is called with identical parameters. Is there a bug in ArcGIS/ArcPy?

Edit:

It seems that only integer values are accepted or the decimal places are cut off.
1.488.. -> = scaling by factor 1, no Exception
0.488.. -> = 0?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

From

Rescale—Data Management toolbox | Documentation 

you will notice in the examples that they pass the numeric value as a string rather than a number

ie " 0.488 "

in your case.  This is indeed strange


... sort of retired...

View solution in original post

2 Replies
DanPatterson
MVP Esteemed Contributor

From

Rescale—Data Management toolbox | Documentation 

you will notice in the examples that they pass the numeric value as a string rather than a number

ie " 0.488 "

in your case.  This is indeed strange


... sort of retired...
MoritzWollen
New Contributor II

Thank you, actually works.

Alternative solution:
I had to make a format adjustment in Windows. After I changed the decimal separator from "." to "," everything works like in the code snippet above, with double values instead of strings.