[GRASS-user] Very high resolution topographic map of Europe: need help and advices

Felix Schalck felix.schalck at gmail.com
Wed Aug 12 12:21:10 EDT 2009


2009/8/12 Markus Neteler <neteler at osgeo.org>:
> On Wed, Aug 12, 2009 at 4:06 PM, Felix Schalck<felix.schalck at gmail.com> wrote:
>> Dear Markus,
>>
>> Thanks to your advices, the production outline has changed to this:
>>
>> 1. Merge the cgiar TIFs (AND NOT THE GRASS RASTERS IF I GOT THIS
>> CORRECTLY) thanks to gdalwrap command. In what projection does this
>> command work ? Is it possible to wrap the TIF directlly in my lcc
>> projection ?
>
> I tried that yesterday and did NOT have luck. I would do it two-pass,
> even if it consumes twice as much space temporaneously:
>
> a) gdalwarp: all into one file, keeping the projection (mosaicking)
> b) gdalwarp: reproject to LCC (note that there are EU LCC and others).
>
> Use your preferred resampling method (gdalwarp offers several).
>
> Perhaps I got something wrong and you can do it in one step as well.
>

I immediately tried this, and ran into following problem:

$gdalwarp srtm_*.tif europe_all_srtmV4_cgiar_default.tif

Creating output file that is 60000P x 36000L.
ERROR 6: A 60000 pixels x 36000 lines x 1 bands Int16 image would be
larger than 4GB
but this is the largest size a TIFF can be.  Creation failed.

If I understand this correctly, I don't have a choice here, and must
reproject the whole thing while pasting it. So I computed this
command:

$gdalwarp -s_srs epsg:4326 -t_srs "+proj=lcc +lat_1=47 +lat_2=41
+lat_0=53 +lon_0=12 +x_0=22.00000 +y_0=15.00000 +ellps=WSG84 +units=m
+no_defs" -tr 93 93 -r bilinear srtm_*.tif
europe_all_srtmV4_cgiar_93m_LCC.tif

It seems to work (at least a 3.6Gb TIF file is created in the right
directory), but takes FOREVER (eg. the 2 first tiles took about 50min,
and I have 56 tiles to be merged...). Strange thing is that neither
the cpu nor the RAM is being used at full extend. The r.patch tool
provided by GRASS went much faster. Any idea here to speed up things ?
Would lowering the resolution (186m would be an option) help ?

>> 2. Add image pyramids with gdaladdo (< I frankly do not underdand this
>> one at all; what does it mean ?)
>
> OK, it means that map copies at lower to much lower resolution are
> stored in the GeoTIFF (or different format which supports pyramids)
> file. When then opening with QGIS, Mapserver etc, it takes advantage
> of that and speeds up in an impressive way the visualization.
> Of course the file size increases.
>
> Example: I take "world natural earth 250m" which is huge; to cover
> Europe you need to download 4 tiles = 8 GB. I added pyramids with
> gdaladdo and now I am able to open these huge 4 tiles in no time
> in one step with QGIS. It's a convenience.
>

Thank you very much for the clear explanation. Indeed, this seems a
very nice option.

>> 3. Shaded relief: I don't know your gdalhillshade command at all. Does
>> it produce the same results as the r.shaded.relief I was planning to
>> use ? Can you set the illumination angle with gdalhilshade ?
>
> Yes.
> I realise that it is called "gdaldem" now.
> http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdaldem.cpp
> http://gdal.org/gdaldem.html
>
>> 4. Re-gdaladdo for the shaded tif.
>
> yes.
>
>> 5. Import in GRASS and checkout results. If I'm right, I will have two
>> layers at this point, one with the relief colors, one with the
>> shadings.
>
> Right (say, one is the relief [colors are optional], the other the shadings).
> You can use d.his or r.his to make a nice shaded colorized terrain
> map, something like this:
> http://grass.osgeo.org/grass60/screenshots/images/etopo2_grass_laea_9_48N_0E.jpg
>

Nice one: leads to a lot of graphical ideas concerning the final map...

>> 6. Coastlines and Rivers. I was planning to use SWBD(coastlines and
>> main rivers) and VLMAP0 Data (for the secondary rivers). Here again,
>> you provide me with a complete new set of tools:
>> r.external/r.terraflow/r.mapcalc/. What is the general idea behind ?
>
> r.external you would use in step 5. Instead of r.in.gdal.
>
> r.terraflow/r.mapcalc you may forget since I didn't understand that you
> would take the rivers as vector maps (I thought you wanted to extract
> them from the DEM).
>

Didn't even think such things were possible, but now that you mention
it, what would be your advice ? Using wmap0 set - with its errors - to
get the rivers, or try to extract them from the DEM ? Which one would
produce the best results (=at 93 or 186m resolution) ?

>> I checked the man pages, but I don't really understand how to use them
>> for my purpose. My plan was to import the shapefile into the right
>> projection with rvin.ogr,
>
> v.in.ogr (or v.external).
>
>> and than export svg files for rework BEFORE
>> joining the river layer and the topographic layers; but perhaps your
>> way, once I understand it, is more efficient.
>
> Not sure (since I was confused :).
>
>> 7. Export the shaded topography with r.out.png in one big png. Do I
>> need two files (one containing the shadings, one with the relief
>> colors) ?
>
> If you do the color shading in GRASS, then you need to export
> only one file.
>
>> 8. Merge topography and hydrography layers in GIMP.
>
> Yes, sounds reasonable.
>
> Please consider to document your steps in the GRASS Wiki,
> it could be useful in future for others.
>

Do you mean writing a tutorial about creating my map ? Never though it
would be able catch readers... But if you seriously think Its worth
it, why not.

> Good luck
> Markus
>

Thanks again for your help,

Felix


More information about the grass-user mailing list