Extract by mask changes the values

3385
5
04-26-2012 10:22 PM
DeanMansfield
New Contributor
Hello

I have a large number of large ascii files and I need the centre values keep the same and the outer areas made NoData (outer values are water, inner values are land). I run the tool 'ASCII to Raster' then 'Extract by Mask' then convert back to ascii with Raster to ASCII.
When I use the Extract by Mask tool it works for the NoData task but the values in some inner cells change, similar yes, but have changed. Why does this tool change the values and how do you stop this?
I have tried many other ways to do the task, but can't even get close, it really doesn't seem like a complex task, it just won't work. Please help
0 Kudos
5 Replies
SteveLynch
Esri Regular Contributor
Dean

What do you mean by changed?

Can you give a before and after example?

Also remember that the raster will be 32 bit floating point precision if your as using the FLOAT option. This means that not all values can be represented exactly.

1.3 for example is represented as 1.2999999523162841796875E0

Hope this helps
Steve
0 Kudos
DeanMansfield
New Contributor
Hi Steve

I can send you an actual file if you want? Some values are out by up to 2-3% of the original value (ie 142 becomes 169)

This tool/process I'm using seems to sample it and comes back with different values.

I want the values to be exactly the same, just with an area around the outside as NoData.

Cheers

Dean
0 Kudos
SteveLynch
Esri Regular Contributor
Dean

Please zip it and send it to slynch@esri.com

Thanks
Steve
0 Kudos
SteveLynch
Esri Regular Contributor
The extents of the 2 raster were different. In many cases the neighboring cell was being queried.

Steve
0 Kudos
YiyueZhang
New Contributor

Hi Steve,

I am facing with the same problem now, and I found Dean's question and your response. I am wondering have you figured out why the re-sampling is happening? I have tried to re-sample my input raster to much smaller cell size then extract by mask to the new input raster, but the cell values are still different in the output raster, even the very center cells. I have set up the extent of extract by mask to be the same as the new input raster, and chose nearest as re-sample method. To my understanding, it should at most only change values of the cells at the edge?

0 Kudos