I have (re-)compiled GRASS 6.4 to try and ensure that I am getting grib support in gdal within GRASS. When I attempt to import a grib file using r.in.gdal, I get an error and GRASS tells me that the file format is not recognized and is not supported. When I list the supported file formats for r.in.gdal, I can not find grib listed as a supported file format. OK, this seems to make sense, except that I did link to gdal (which I built from source) and if I run: gdalinfo gribfilename.grb, I get very reasonable output about the file. So, I don't understand why gdalinfo recognizes my grib file, yet GRASS linked against gdal does not list grib as a supported file format and does not recognizes my grib file.
Regards,
Tom
--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177
I have (re-)compiled GRASS 6.4 to try and ensure that I am getting grib support in gdal within GRASS. When I attempt to import a grib file using r.in.gdal, I get an error and GRASS tells me that the file format is not recognized and is not supported. When I list the supported file formats for r.in.gdal, I can not find grib listed as a supported file format. OK, this seems to make sense, except that I did link to gdal (which I built from source) and if I run: gdalinfo gribfilename.grb, I get very reasonable output about the file. So, I don't understand why gdalinfo recognizes my grib file, yet GRASS linked against gdal does not list grib as a supported file format and does not recognizes my grib file.
Tom,
please check with
ldd `which r.in.gdal`
ldd `which gdalinfo`
which GDAL libs are used. Perhap you have two installations on the machine?
If GDAL can read it then GRASS should be able to as well, all
versions being equal. 'r.in.gdal -f' (in grass 6.5 anyway) gets
its format list directly from libgdal.. so as Markus suggests
check for new & old version of gdal. For GRIB support you'll
probably want to use the very latest GDAL release as it is new
there and still maturing. You need a gdal version >1.5.
if gdal tools can see it, an in-between work-around is to convert
the grib to geotiff with gdal_translate, then load the geotiff
into grass.
see http://grass.osgeo.org/wiki/GRIB
As you suspected, there was a problem with a 2nd gdal installation. The environment I am working in, is a networked environment with many NSF mounts to local workstations and servers. I am required to put any new GRASS (or other software, including gdal) installations in a non-standard location, one which is accessible to any user logged into any of the networked computers. It turns out that there is also an older GRASS installation (6.2.2) on all machines in /usr/local, which is built on version 1.4.x of gdal. Even though when building GRASS using ./configure, the older gdal libraries were being used by my new install of GRASS 6.4 and r.in.gdal. So, I suppose the older version of gdal 1.4.x did not support GRIB.
I'm still confused why the older gdal libs were being used rather than my newer vesion. Is this a LD_LIBRARY_PATH issue or what? To get r.in.gdal to import the GRIB files, I have pointed the /usr/local/gdal directory to the newer gdal install I built rather than the older version.
Thanks again for your help!
Tom
Markus Neteler wrote:
Thomas Adams wrote:
All:
I have (re-)compiled GRASS 6.4 to try and ensure that I am getting grib support in gdal within GRASS. When I attempt to import a grib file using r.in.gdal, I get an error and GRASS tells me that the file format is not recognized and is not supported. When I list the supported file formats for r.in.gdal, I can not find grib listed as a supported file format. OK, this seems to make sense, except that I did link to gdal (which I built from source) and if I run: gdalinfo gribfilename.grb, I get very reasonable output about the file. So, I don't understand why gdalinfo recognizes my grib file, yet GRASS linked against gdal does not list grib as a supported file format and does not recognizes my grib file.
Tom,
please check with
ldd `which r.in.gdal`
ldd `which gdalinfo`
which GDAL libs are used. Perhap you have two installations on the machine?
Markus
--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177
On Mon, Dec 07, 2009 at 07:57:31AM -0500, Thomas Adams wrote:
Markus & Hamish,
is also an older GRASS installation (6.2.2) on all machines in
/usr/local, which is built on version 1.4.x of gdal. Even though
when building GRASS using ./configure, the older gdal libraries were
being used by my new install of GRASS 6.4 and r.in.gdal. So, I
suppose the older version of gdal 1.4.x did not support GRIB.
I'm still confused why the older gdal libs were being used rather
than my newer vesion. Is this a LD_LIBRARY_PATH issue or what? To
If the older and newer gdal libraries share the same soname, (which
seems to be the case, libgdal.so.1) what will determine the order
of library loading at runtime is the order of the dynamic loader.
Explicitly setting LD_LIBRARY_PATH should certainly allow to search
first in some directory rather than another, though.
With a library like gdal, in fact, the soname doesn't really tell
much about the capabilities of the library, since it depends a lot
on the available formats and it cannot be in the ABI.
As you suspected, there was a problem with a 2nd gdal
installation. The environment I am working in, is a
networked environment with many NSF mounts to local
workstations and servers. I am required to put any new GRASS
(or other software, including gdal) installations in a
non-standard location, one which is accessible to any user
logged into any of the networked computers. It turns out
that there is also an older GRASS installation (6.2.2) on
all machines in /usr/local, which is built on version 1.4.x
of gdal. Even though when building GRASS using ./configure,
the older gdal libraries were being used by my new install
of GRASS 6.4 and r.in.gdal. So, I suppose the older version
of gdal 1.4.x did not support GRIB.
right, grib support was added to gdal in version 1.5.
I'm still confused why the older gdal libs were being used
rather than my newer vesion.
did the './configure --with-gdal=/.../gdal-config' point to the right
one?
Is this a LD_LIBRARY_PATH issue
or what? To get r.in.gdal to import the GRIB files, I have
pointed the /usr/local/gdal directory to the newer gdal
install I built rather than the older version.
AFAIK LD_LIBRARY_PATH gets scanned before the regular ldconfig path.
remember to `export` the bash variable if you use that.