Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a raster with values ranging from 0 to 8991130624. This raster is actually the result of a cost distance analysis.

I want to scale the raster to range from 0 to 1 and take the inverse? so that a cell with the highest cost/value (e.g. 8991130624) will now have a value of 0 while a cell with the lowest cost/value (e.g. 0) will now have a value of 1.

I am using raster calculator with the following expression:

1-(x/8991130624)

where I add x to the expression by clicking on the raster from the list of available rasters when using the tool

This is not working and producing an error: "ERROR 000539: Error running expression; rcexec() :ERROR 999998:Unexpected Error."

Can someone tell me what I'm doing wrong?

share|improve this question

2 Answers

Make sure you have spaces on either side of the mathematical operators:

1 - (x / 8991130624)
share|improve this answer
Thanks! I'll check this out! – Julie Apr 15 at 23:52

Also it should be 1.0 - (x / 8991130624) otherwise you may end up with just 1's and 0's

To edit, if the values are cast as integers, you will end up with 0 or 1. At least one value must be a float, hence, 1.0 will ensure that the output is a floating point value between 0 and 1.

share|improve this answer
1  
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. – Fezter May 19 at 23:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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