[Mapserver-users] GRASS raster from GDAL

Jan Hartmann jhart at frw.uva.nl
Thu Apr 3 04:38:49 EST 2003


Matt,

As far as I have experimented, there are two ways of accessing GRASS 
data with GDAL:

- Standalone GDAL utilities, like gdalinfo and gdal_translate use the 
.grassrc5 file in the $HOME-directory. Any mapset in the current 
database location can be accessed by its name or qualified name (e.g. 
nations, or nations at PERMANENT in the "global" database). According to 
the README in the libgrass distribution, MapServer uses the .grassrc5 
file in the Document_Root directory of the Apache webserver, but that 
didn't work with me.

- Alternatively, you can use the full path to the raster layer in the 
cellhd subdirectory, irrespective of .grassrc5: 
$HOME/grass5/data/global/PERMANENT/cellhd/nations.
This works both with MapServer and the standalone applications. I'm not 
quite clear how GDAL handles GRASS colortables.

BTW: GRASS 5.1 alpha supports direct reading of PostGIS vector files. 
Together with the existing PostgreSQL query commands within GRASS 
(d.site.pg etc), and the libgrass link between MapServer and GRASS, 
there are great possibilities now to integrate MapServer, PostGIS and GRASS

BTW2: Slightly off topic, but in the same vein: Joe Conway has just 
released PL/R, a new language for use within PostgreSQL 
(www.joeconway.com). With it you can access within PostgreSQL 
practically all statistical functions from the the R program 
(http://www.r-project.org/). In standard SQl you already can write 
functions like "select avg(myvar)". With PL/R you can do thing like: 
"select median(myvar)" and much more complicated statistics. All this 
can  be combined with the PostGIS/MapServer/GRASS interface. It's really 
a marvelous example of the way Open Source programs can be integrated.

Jan

Matt Doggett wrote:
> I have GDAL compiled --with-grass and the gdal-config --formats confirms
> that grass is indeed supported. My mapserver is compiled --with-gdal and
> the mapserv -v confirms this. Great!
> 
> So now, how the heck do you access the grass raster data using GDAL?
> What should the mapfile look like?  Examples anyone?  I've tried what I
> know (which isn't much) and there's so little documentation out there so
> I defer to the group...
> 
> Matt
> 
> Matt Doggett
> Spatial Climate Analysis Service
> Oregon State University
> 316 Strand Ag Hall
> Corvallis, OR 97331
> (541)737-9153
> mdoggett at coas.oregonstate.edu
>  
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 
Jan Hartmann
Department of Geography
University of Amsterdam
jhart at frw.uva.nl




More information about the mapserver-users mailing list