Hi,
I was asked to write a raster of an Digital Terrain Model to an Esri ASCII Grid file. However, the aim of the end user was to maintain a precision of 3 decimal values for the pixel values, so that the file size would not get too large.
To illustrate the question I created a short sample workspace.
A visual preview of the RasterNumericCreators result is shown below;
At the red dot (row,col) = (0,2), we can see that the pixel value is equal to '0.0250313' (using a ~'data value encoding' of 'Real32').
After the RasterCellValueRounder, we see that the value for this specific pixel is changed to '0.025' (as desired);
However, when I write out the Raster to Esri ASCII Grid, and open the result in a text editer, I see the following (only first rows/columns shown);
Specifically, the indicated pixel is written out with a value of '0.02503128908574581'.
For this dummy file, the file size is 9.54 kb. If however I manually update the raster file so that the pixels are written out with a precision of 3 decimals, like such;
The file size is reduced to 5.51 kb.
Thus, when the values would be written out with a precision of 3 decimal places, the file size is reduced with more than 42%
For these demo files the absolute file size of these ASCII Grid files is of course really low, but you can imagine that for the actual raster files (Digital Terrain Models), a reduction of 42% in the filesize will make a sizeable difference.
In this case the application that is reading in the ASCII Grid files takes a long time to read/process the Real64 encoded ASCII Grid files that are created by FME (for some reason the writer seems to convert to Real64), and reducing the filesize would make the files better manageable in their software.
I was already thinking about workarounds to deal with this problem. I have some seperate questions about (the efficiency of) these workarounds. To keep the question to the point however, I think it might be best to create community questions about this, which I will add links to below (at a later stage).
For this main question I'm mainly concerned if there are some obvious things I'm overlooking, and whether the gist of this question could be tackled in some straightforward way. I don't really see any parameters for the Esri ASCII Grid writer where I can control the pixel/number accuracy (or the interpretation, which seems to be fixed to Real64 in this writer).
Kind regards,
Thijs