[gdal-dev] Re: Hillshade + Topographic Map??
tjmgis at gmail.com
Tue Feb 21 13:25:41 EST 2012
Many thanks for your help.
Lots of recommendations and I have tried each one with limited success
1) QGIS - works but i need a permanent copy.
2) GIMP - problem with this is GIMP does not recognise my rasters. I have
expanded to color table to rgb and it still wouldnt open the file. It would
open the hillshade however its 2gb so it fell over half way through
3) hsv_merge.py - this initially did not work because the hillshade is
actually a different pixel size to the topo map even though they cover the
same area. So i used gdal to increase the size of the hillshade and then
ran the hsv_merge.py
it created a 98GB geotiff!! which i then compressed using gdal_translate,
ended up being 268Mb!!
However, as advised the colours were way off.
I tried to edit the python script but get indent errors or it does not know
what v_norm is.
4) then tried SASS GIS and when I open my rasters they are in a black
colour ramp even though they are RGB and I cannot figure out how to change
that so they load normally. Also SASS wont load a big tiff file in anyway.
5) Looked at GMT and I cannot find the options to load two rasters on top
of each other.
6) MIRONE - again cannot see how to do this from within the application.
The only real success was mapnik, however creating a map file looking at
2000 topogrpahic maps and 20000 hillshade map is crazy and even if I point
to the VRT for each, mapnik cannot create an image of 132000 by 248000 that
So after a very frustrating day I still do not have an answer!
So if there is any other ideas or methods I would really appreciate the help
On 21 February 2012 15:11, Joaquim Luis <jluis at ualg.pt> wrote:
> On 21-02-2012 14:11, Rutger wrote:
>> TJMartin wrote
>>> Is there a way to combine the hillshade and topo map together - ie add a
>>> transparency or opacity to the hillshade.
>>> A common way is to convert your (i assume) RGB topo map to HSV color
>> and replace the intensity band (v) with your hillshade. This is for
>> nicely shows at Franks blog:
>> I find replacing the entire intensity band always a bit harsh since for
>> area's you would like to stick to your original color/data.
>> This can be done by normalizing the hillshade band with the zenith angle
>> used to create is. Following the hsv_merge.py script on Franks blog, the
>> original replacement of:
>> /hsv_adjusted = numpy.asarray( [hsv, hsv, v] )/
>> Woud become something like:
>> /v_norm = v * hsv / ( 255 * math.cos(zenith * (math.pi / 180.0)))
>> hsv_adjusted = numpy.asarray( [hsv, hsv, numpy.where( v_norm> 255,
>> 255, v_norm )] )/
>> You have to pay a bit attention to avoid saturating the normalized band.
>> This can be done by choosing a zenith angle wich gives a flat surface a
>> value halfway your range of 0 and 255.
> GMT does that for ages. But it doesn't replace the intensity with shading.
> Instead the shading is used to change the saturation of HSV making the
> facets facing illumination light become brighter and the other become
> See for example
> With GMT5 one can compute the shading of a grid and apply it to an image.
> Here goes a small example of the GMT's test set
> Even simpler is to use Mirone. We can do the above just with a couple of
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev