[GRASS-user] exporting maps via gdal

Matthew Perry perrygeo at gmail.com
Mon Jul 17 13:41:17 EDT 2006


Jachym,

On 7/17/06, Jachym Cepicky <jachym.cepicky at centrum.cz> wrote:
> > > trying to export some floating point map (result of interpolation) to
> > > geotiff via gdal:
> > >
> > >     r.out.gdal in=ca2005 out=ca2005.tif type=Float32
> > >
> > > result is, that the map is displayed as "black" e.g. in qgis and
> > > mapserver is not able to display anything :-(
> > >
> > Jachym,
> >
> > you could try to export to ERDAS/IMG format (format=HFA).
> > Maybe then the color tables is preserved.
> >
> > Markus
>
> hmm, problem is, that the map can not be displayed via mapserver - how
> do you export any floting point geotiff ?
>
> thanks
>     jachym
>

The r.out.gdal output *can* be displayed with mapserver but, since it
has no associated color palette (that mapserver can understand
anyhow), mapserver will render it in a black->white color ramp. If
your data values are very skewed, it may appear all black. Try using
the SCALE processing directive to set the min and max of the b&w color
ramp. (http://mapserver.gis.umn.edu/docs/howto/raster_data/#special-processing-directives)

Also, Have you tried r.out.tiff ? This will export a colored image of
your data at the current region settings. The resulting tiff will not
contain actual values but will look as it did in grass.

r.out.tiff -t input=elevation.dem output=elev

You can use the r.out.tiff output for display purposes and the
r.out.gdal output for query purposes.

Finally you might want to try reading the grass raster directly from
mapserver and avoid the conversion step altogether.


-- 
Matt Perry
perrygeo at gmail.com
http://www.perrygeo.net




More information about the grass-user mailing list