Opened 13 years ago
Closed 13 years ago
#3657 closed defect (fixed)
AAIGrid does not detect "1e+05" as a real value among integer values
Reported by: | rhijmans | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.8.0 |
Component: | GDAL_Raster | Version: | 1.7.1 |
Severity: | normal | Keywords: | |
Cc: |
Description
I think that rgdal has a problem with arc-ascii (AAIGrid) values in exponential notation if the coefficient does not have a decimal notation and if all the other values are integers.
For example If you mix "1e+05" with integers, the file is considered to contain integers and "1e+05" is interpreted as "1" (this would not be the case with 1.0e+05). See an example file below. GDAL reads this as having values 1,2,3,4,1,6, rather than 1,2,3,4,1000,6
A possible solution is to not only scan the first 100 kb of the file for occurrences of '.' but also for 'e'.
Would it not be better to always treat AAIGrid as containing real numbers? The current approach leads to errors in data analysis. The alternative is perhaps less efficient, but that seems a small price to pay for getting the right numbers.
Example file:
ncols 3 nrows 2 xllcorner -180 yllcorner -90 cellsize 1 NODATA_value -9999 1 2 3 4 1e+03 6
Change History (1)
comment:1 by , 13 years ago
Milestone: | → 1.8.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in trunk in r19956