Opened 8 years ago
Closed 8 years ago
#6060 closed enhancement (fixed)
AAIGrid: writing float types should ensure that a decimal is in the first pixel
Reported by: | Mike Taves | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.0.1 |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | aaigrid |
Cc: |
Description (last modified by )
TL; DR: for float ASC rasters, ensure the first pixel value has a .
, e.g.
… cellsize 1.000000000000 0. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 …
ESRI ASCII Grid files (ASC) do not explicitly store their datatypes, so when ASC rasters are opened by GDAL or other software, the data type is evaluated from some/all of the pixel data to see if there is a .
character.
While GDAL is fairly robust at correctly interpreting if a raster is integer or float type, other software such as ArcGIS is not. For instance, a raster that is mostly zero is interpreted by ArcGIS as signed integer. But modify the first pixel of the ASC file from 0
to 0.
corrects the interpretation to floating point. (This is not an issue with GDAL, which evaluates 100% of the data, not 100 kB as documented).
A suggestion for writing float rasters is to check if the formatted string of the first pixel of the first line has a .
character. If not, and the value is finite (not NaN, Inf, etc.), append a .
to that first value.
Attachments (1)
Change History (3)
by , 8 years ago
Attachment: | Comparison_of_asc.png added |
---|
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
Keywords: | aaigrid added |
---|---|
Milestone: | → 2.0.1 |
Resolution: | → fixed |
Status: | new → closed |
Comparison of Arc ASCII Grid files in ArcGIS 10.0