[GRASS-user] problem importing .adf format with r.in.gdal

Hello all,

I am having some trouble importing Arc/Info Grid files into GRASS using
r.in.gdal. I am on GRASS 6.4 on MacOS 10.5.

The data I am trying to use is estimates of global carbon density, which is
found here.
http://cdiac.ornl.gov/ftp/global_carbon/datasets.zip

The data exists at three spatial resolutions: 1km x 1km; 5minute x 5minute;
and 10minute x 10minute. I want to import and use the highest (1km x 1km)
resolution. The (odd?) thing is, I have successfully imported the 5minute x
5minute data, but I cannot get the 1km x 1km.

I have used r.in.gdal

r.in.gdal input=/Users/usr/datasets/c_5m/hdr.adf output=IPCC_Carbon_5min

--o -o
It imports successfully, and

r.univar IPCC_Carbon_5min

returns

total null and non-null cells: 500000
total null cells: 326493

Of the non-null cells:
----------------------
n: 173507
minimum: 0
maximum: 372.142
range: 372.142
mean: 20.5885
mean of absolute values: 20.5885
standard deviation: 41.6786
variance: 1737.1
variation coefficient: 202.437 %
sum: 3572242.931286566

But when I try exactly the same code with the higher resolution version,

r.in.gdal input=/Users/usr/datasets/c_1km/hdr.adf output=IPCC_Carbon_1km

--o -o
I get
WARNING: G_set_window(): Illegal latitude for North
and it will not import.

I tried using gdal_translate because that fixed a problem I had before with
'illegal latitude for north'

gdal_translate -of GTiff -a_ullr 180W 90N 180E 90S

src_dataset=/Users/timholland/c_1km/hdr.adf dst_dataset=IPCC_Carbon_1km
But I get the message
ERROR 4: `src_dataset=/Users/timholland/c_1km/hdr.adf' does not exist in the
file system,
and is not recognised as a supported dataset name.

Also, everything I have tried with the hdr.adf file in the directory (as
shown in the above), I have also tried with the w100100.adf file, with the
same results (the 5minute resolution file works, the 1km resolution one does
not).

Thanks very much for any help.

Best,
Tim

--
View this message in context: http://n2.nabble.com/problem-importing-adf-format-with-r-in-gdal-tp3596544p3596544.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Tim Holland wrote:

But when I try exactly the same code with the higher
resolution version,
>r.in.gdal input=/Users/usr/datasets/c_1km/hdr.adf
output=IPCC_Carbon_1km --o -o
I get
WARNING: G_set_window(): Illegal latitude for North
and it will not import.

in grass 6.5 and 7 r.in.gdal has a new -l flag to get around
that. GRASS in lat/lon mode will refuse to accept e.g. +91 as
a valid latitude. If georeferencing does not exist it uses
pixel/cell values as north and east, and if there are more than
90 rows you get an error.

I tried using gdal_translate because that fixed a problem I
had before with 'illegal latitude for north'
>gdal_translate -of GTiff -a_ullr 180W 90N 180E 90S
src_dataset=/Users/timholland/c_1km/hdr.adf
dst_dataset=IPCC_Carbon_1km
But I get the message
ERROR 4: `src_dataset=/Users/timholland/c_1km/hdr.adf' does
not exist in the
file system, and is not recognised as a supported dataset name.

I don't know why, but you will have to fix the gdal_translate
problem. Perhaps just pass it
src_dataset=/Users/timholland/c_1km
instead of the full .adf filename? check the www.GDAL.org
supported formats page for help with that type of data.

Hamish

On Sep 7, 2009, at 7:50 AM, Hamish wrote:

Tim Holland wrote:

But when I try exactly the same code with the higher
resolution version,

r.in.gdal input=/Users/usr/datasets/c_1km/hdr.adf

output=IPCC_Carbon_1km --o -o
I get
WARNING: G_set_window(): Illegal latitude for North
and it will not import.

in grass 6.5 and 7 r.in.gdal has a new -l flag to get around
that. GRASS in lat/lon mode will refuse to accept e.g. +91 as
a valid latitude. If georeferencing does not exist it uses
pixel/cell values as north and east, and if there are more than
90 rows you get an error.

I've also noticed rounding errors coming from Arc raster sources, especially at higher resolutions. The cell size will be something like 0.000277778 (for 1sec) instead of having more digits. Added up for a full degree, you get slightly more than a degree.

Probably something to do with single precision that is common in Arc. I get this when downloading DEM data from the USGS Seamless.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

The equator is so long, it could encircle the earth completely once.

This might help someone who is trying to run the v.rast.stats (univariate statistics of raster values inside a vector area) in the GRASS 6.4 windows distribution.
If the error message which appears when running v.rast.stats is "Cannot continue (problem adding columns)" it might be due to the v.db.addcol module not being correctly accessed by the script because it looks for it in the bin directory where it only finds the v.rast.stats.bat file (developers can correct me if I am wrong!). You can solve this by copying the v.db.addcol script that you find in the script directory in the bin directory. It worked for me, of course it is only a hack.
Cheers!
--

*Francesco Pirotti*
Dep. TESAF
CIRGEO – Interdepartmental Research Center on Cartography Photogrammetry
Remote Sensing and G.I.S.
University of Padova
Web: http://www.cirgeo.unipd.it/cirgeo/francescopirotti.htm
Email: francesco.pirotti@unipd.it <mailto:jdohn@freeemailtutorials.com>
Phone: +39 049 827 2710