[GRASS-user] using grass on rasters without converting?

Markus Neteler neteler at osgeo.org
Thu Oct 30 09:25:29 EDT 2008


On Thu, Oct 30, 2008 at 2:08 PM, Jan Hartmann <j.l.h.hartmann at uva.nl> wrote:
> Markus Neteler wrote:
>> r.external - Link GDAL supported raster file to a binary raster map layer.
>> http://grass.osgeo.org/grass64/manuals/html64_user/r.external.html
>>
>
> This solves a need for me too. Could something like that be done for WMS
> services, i.e. not downloading them with r.in.wms, but linking them without
> making a local copy?

In theory, r.external might also accept WMS since GDAL does it:
http://www.gdal.org/frmt_wms.html

cat gdal_wms.xml
<GDAL_WMS>
    <Service name="WMS">
        <Version>1.1.1</Version>
        <ServerUrl>http://onearth.jpl.nasa.gov/wms.cgi?</ServerUrl>
        <SRS>EPSG:4326</SRS>
        <ImageFormat>image/jpeg</ImageFormat>
        <Layers>modis,global_mosaic</Layers>
        <Styles></Styles>
    </Service>
    <DataWindow>
        <UpperLeftX>-180.0</UpperLeftX>
        <UpperLeftY>90.0</UpperLeftY>
        <LowerRightX>180.0</LowerRightX>
        <LowerRightY>-90.0</LowerRightY>
        <SizeX>2666666</SizeX>
        <SizeY>1333333</SizeY>
    </DataWindow>
    <Projection>EPSG:4326</Projection>
    <BandsCount>3</BandsCount>
</GDAL_WMS>

# this works:
qgis gdal_wms.xml

# this, too:
r.external /tmp/gdal_wms.xml out=gdal_wms

g.region n=90 s=-90 w=-180 e=180 res=1 -p
d.mon x0
d.rast gdal_wms

# this gets stuck:
d.rast gdal_wms
   0%

strace shows
...
select(8, [6 7], [], [], {0, 100000})   = 0 (Timeout)
poll([{fd=6, events=POLLIN|POLLPRI}], 1, 0) = 0
poll([{fd=7, events=POLLIN|POLLPRI}], 1, 0) = 0
select(8, [6 7], [], [], {0, 100000})   = 0 (Timeout)
...

Maybe some update magic is needed internally (but maybe
I am exaggerating right now...).

Markus


More information about the grass-user mailing list