Hi Martin and Markus,

The GDAL VRT-format is really very handy for many kinds of data extraction, so 
I simply applied one of my most important learning-strategies (not only for 
GIS): "try-and-error"
However, I have to admit, that I did not really understand your last question, 
Martin:

What do you mean by a "bunch of vrt" if you only have 4 maps? Did you set -te 
according to the size limits of the server and therefor get maybe hundrets of 
tiles? And if r.in.gdal allows you to import more than WCS-limits for HEIGHT 
and WIDTH, did you try to import your entire region of interest through the 
second vrt?

Alternatively you could try something like this (Unix shell script for GRASS 
6.4 (in GRASS 7 r.tileset seems to be still broken, see 
http://trac.osgeo.org/grass/ticket/1825):
This solution assumes that you set your GRASS region to your entire area of 
interest...

source_prj=`eval g.proj -fj`
r.tileset sourceproj="$source_prj" maxcols=1024 maxrows=1024 fs=' ' --q | awk 
'{print "gdalbuildvrt ./dem_wcs_bb_"NR".vrt ./dem_wcs.vrt -te " $1, $2, $3, $4 
}' | sh
gdalbuildvrt vrtmosaic.vrt dem_wcs_bb_*.vrt
r.in.gdal input=vrtmosaic.vrt output=test_wcs

Please note that the WCS I used for testing probably does not have any 
tile-limits because I am having no issues (on UBUNTU 12.04 and GRASS 7 / GRASS 
6.4.4).

As for the r-flag Markus mentioned: personally I would not miss it in 
r.external because data is not really duplicated, or are there drawbacks when 
registering big external datasets?
In r.in.gdal it might be useful, but does the module change the resolution or 
would it do so if a bounding box is applied to the input-raster?

Cheers
Stefan 

-----Original Message-----
From: martin.zbin...@gmail.com [mailto:martin.zbin...@gmail.com] On Behalf Of 
Martin Zbinden
Sent: 5. januar 2014 00:10
To: Blumentrath, Stefan
Subject: Re: [GRASS-user] WCS import into GRASS GIS - select region extent only

Wow, great! This trick with a second VRT works with gdal_translate and 
r.in.gdal, with the second even in case of regions bigger than MAXSIZE. How did 
you find that out, if I may ask you?

What do you think: I have to handle at least 4 raster maps. What is the most 
efficient way to organize this bunch of VRTs?
I think, I could base on the function _createXML() from r.in.wms2 an generate 
the VRT myself. The second VRT introduces the following important lines 
depending on TE parameter:

<VRTDataset rasterXSize="2750" rasterYSize="1750"> <GeoTransform>  
2.5920000000000000e+06,  2.0000000000000000e+00, 0.0000000000000000e+00,  
1.1825000000000000e+06, 0.0000000000000000e+00, 
-2.0000000000000000e+00</GeoTransform>
<SrcRect xOff="53296" yOff="56718" xSize="174216" ySize="110331" />

Cheers and good night
Martin

--
Martin Zbinden
Riedacker 523
3154 Rüschegg Heubach
+41 78 628 28 82


2014/1/4 Blumentrath, Stefan <stefan.blumentr...@nina.no>:
> Actually, a second vrt does the trick:
>
> gdalbuild vrt dem_wcs_bb.vrt dem_wcs.vrt -te 381464.564874 
> 7282848.63791 422460.634623 7310018.58218
>
> This worked for me.
> I shall add the solution to the Wiki.
>
> Cheers
> Stefan
>
> -----Original Message-----
> From: martin.zbin...@gmail.com [mailto:martin.zbin...@gmail.com] On 
> Behalf Of Martin Zbinden
> Sent: 4. januar 2014 23:32
> To: Blumentrath, Stefan; nete...@osgeo.org
> Cc: grass-user@lists.osgeo.org
> Subject: Re: [GRASS-user] WCS import into GRASS GIS - select region 
> extent only
>
> Hi Stefan, hi Markus,
> I just started to think over everything again after Stefans first maill... 
> thanks for the fast reaction. I just tried the proposed HEIGHT and WIDTH 
> parameter with gdal_translate without success.
>
> I started to observe the HTTP-transfer with mitmproxy [1]. I can see, that 
> BBOX parameter is just ignored. Also i can see, that r.in.gdal by itself 
> seems to know about tile-size-limitations and starts to download small 
> 2MB-tiles, while gdal_translate just tries to get it all in one file. If you 
> are interested in more details, I can share these observations on the new 
> WCS-wikipage?
>
> Concerning the "limit import to current region flag" I agree absolutely with 
> you two, I would just take it with a handkiss. Would this -r flag be 
> something easy and quick to implement? I see that r.in.gdal is a compiled 
> binary, so nothing I believe I can do myself.
>
> Thanks to for the python-based-approach, which hopefully will respect 
> tile-size limits. I'll give it a try, until the -r flag will be reality.
>
> Cheers,
> Martin
>
>
>
> [1] http://mitmproxy.org/
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to