[GRASS-user] WCS import into GRASS GIS - select region extent only

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Fri Jan 3 13:50:42 PST 2014


Hei Martin,

You could try making a (temporary) virtual GDAL-VRT dataset (it’s a simple textfile (XML) containing information like this, in the example below named "dem_wcs.vrt"):

<WCS_GDAL>
 <ServiceURL>http://your_wcs_server/wcs.dtm?</ServiceURL>
 <CoverageName>layername</CoverageName>
</WCS_GDAL>

For more info on vrt-format see:
http://www.gdal.org/gdal_vrttut.html 

After that you could use gdal_translate (http://www.gdal.org/gdal_translate.html), which has a projwin parameter where you can feed you GRASS region boundaries from g.region -up:
gdal_translate -co "COMPRESS=LZW" -projwin ulx uly lrx lry dem_wcs.vrt dem_wcs.tif

Hope that helps,

Cheers
Stefan

-----Original Message-----
From: grass-user-bounces at lists.osgeo.org [mailto:grass-user-bounces at lists.osgeo.org] On Behalf Of Martin Zbinden
Sent: 3. januar 2014 21:46
To: grass-user at lists.osgeo.org
Subject: [GRASS-user] WCS import into GRASS GIS - select region extent only

Hi,

For my Bachelor-Thesis I want to optimize the erosion risk map of Switzerland for use in agricultural extension. Although I concentrate on 3 cantons only (BE, FR, SO),  I have to manage huge amounts of data. The fact that the raster data I got from the federal office are overlapping each other (following the defined fieldblocks) doesn't make things easier, but I've at least found r.patch which can combine them one by one.

I thought, with Mapserver  (V 6.4.0) I'd found the perfect solution to all my problems. Now I'm stuck after 5+ hours of trying to import the data from my local WCS-Service. I have seen the hints on GRASS Wiki [1] and r.in.gdal starts to download geotiff-tiles from Mapserver. The problem is, that I don't want all the 12 GB of data, but only the grass region extent.

The following http-query does what I expect, it makes me a GeoTIFF-File from my region defined by BBOX=... .
http://localhost/mywcs?SERVICE=WCS&VERSION=1.0.0&REQUEST=GetCoverage&coverage=blw.eros_z&FORMAT=image/tiff&CRS=EPSG:2056&BBOX=2596000,1181000,2597500,1182500&RESX=2&RESY=2


I tried to restrict the download to the  region by defining a BBOX in this WCS_GDAL xml file. However, this didn't work and isn't supposed to work [2]. Is there a way to say r.in.gdal to only get the data from the region extent?

I know there is this new, very clever r.in.wms2 script, which does exactly what I want -- for WMS. Is there a way to get WMS-Mapserver to serve RAW-data (erosion in t per annum, elevation data)?  Or maybe better create a python script to download map by a custom http-request?

Thanks in advance for any advice! I hope I can get it to work somehow.
Liebe Grüsse
Martin Zbinden

PS: the WCS server given in GRASS wiki seems to be down this time.

[1] http://grasswiki.osgeo.org/wiki/Global_datasets#OGC_WCS_-_Albedo_example
[2] http://lists.osgeo.org/pipermail/gdal-dev/2008-March/016552.html


--
Martin Zbinden
Riedacker 523
3154 Rüschegg Heubach
+41 78 628 28 82
_______________________________________________
grass-user mailing list
grass-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list