Hi
I have managed to create a hillshade using gdaldem and I have my original topographic rasters. However I do not want the standard grey hillshad or apply a colour ramp. Is there a way to combine the hillshade and topo map together - ie add a transparency or opacity to the hillshade. I have looked at Photopshop and ImageMagik but the results are then not supported in QGIS etc After a trawl through the web the only entry is an ArGIS 10 tutorial http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t000001v1000000 Hopefully that will explain what I would like to achieve thanks for anyones help Tim |
Hi,
the standard procedure for creating topo-maps is to overlay your land coverage map with a semi-transparent hillshading. I don't know if there's a tool for combining/adding two raster maps together in gdal, but this is a rather standard procedure in any GIS. In QGIS, for example, you can adjust the layer transparency slider to get the effect. If you want to create a more permament combination of the land coverage and hillshade, you can use a software like GIMP to combine the two maps. Mapserver may be able to create a georeferenced version of your combination also, as does mapnik. The biggest problem is probably to overcome the alpha-transparency for your hillshading, which is not something that every raster library is able to handle well. Frank Am 21.02.2012 11:01, schrieb TJMartin: > Hi > > I have managed to create a hillshade using gdaldem and I have my original > topographic rasters. However I do not want the standard grey hillshad or > apply a colour ramp. > > Is there a way to combine the hillshade and topo map together - ie add a > transparency or opacity to the hillshade. > > I have looked at Photopshop and ImageMagik but the results are then not > supported in QGIS etc > > After a trawl through the web the only entry is an ArGIS 10 tutorial > > http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t000001v1000000 > > Hopefully that will explain what I would like to achieve > > thanks for anyones help > > Tim > > -- > View this message in context: http://osgeo-org.1560.n6.nabble.com/Hillshade-Topographic-Map-tp4490698p4490698.html > Sent from the GDAL - Dev mailing list archive at Nabble.com. > _______________________________________________ > gdal-dev mailing list > [hidden email] > http://lists.osgeo.org/mailman/listinfo/gdal-dev > -- Frank BRONIEWSKI METRICO s.à r.l. géomètres technologies d'information géographique rue des Romains 36 L-5433 NIEDERDONVEN tél.: +352 26 74 94 - 28 fax.: +352 26 74 94 99 http://www.metrico.lu _______________________________________________ gdal-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/gdal-dev |
The workflow with QGIS described by Frank is also working with SAGA GIS.
SAGA also allows you to export a permament combination as image file (tif, jpg, png ... including world file and kml) with the 'Export Image' module. Volker On 02/21/2012 02:14 PM, Frank Broniewski wrote: > Hi, > > the standard procedure for creating topo-maps is to overlay your land > coverage map with a semi-transparent hillshading. I don't know if > there's a tool for combining/adding two raster maps together in gdal, > but this is a rather standard procedure in any GIS. In QGIS, for > example, you can adjust the layer transparency slider to get the effect. > > If you want to create a more permament combination of the land coverage > and hillshade, you can use a software like GIMP to combine the two maps. > > Mapserver may be able to create a georeferenced version of your > combination also, as does mapnik. The biggest problem is probably to > overcome the alpha-transparency for your hillshading, which is not > something that every raster library is able to handle well. > > Frank > > Am 21.02.2012 11:01, schrieb TJMartin: >> Hi >> >> I have managed to create a hillshade using gdaldem and I have my original >> topographic rasters. However I do not want the standard grey hillshad or >> apply a colour ramp. >> >> Is there a way to combine the hillshade and topo map together - ie add a >> transparency or opacity to the hillshade. >> >> I have looked at Photopshop and ImageMagik but the results are then not >> supported in QGIS etc >> >> After a trawl through the web the only entry is an ArGIS 10 tutorial >> >> http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t000001v1000000 >> >> >> Hopefully that will explain what I would like to achieve >> >> thanks for anyones help >> >> Tim >> >> -- >> View this message in context: >> http://osgeo-org.1560.n6.nabble.com/Hillshade-Topographic-Map-tp4490698p4490698.html >> >> Sent from the GDAL - Dev mailing list archive at Nabble.com. >> _______________________________________________ >> gdal-dev mailing list >> [hidden email] >> http://lists.osgeo.org/mailman/listinfo/gdal-dev >> > > _______________________________________________ gdal-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/gdal-dev |
In reply to this post by TJMartin
Hey,
A common way is to convert your (i assume) RGB topo map to HSV color space and replace the intensity band (v) with your hillshade. This is for example nicely shows at Franks blog: http://fwarmerdam.blogspot.com/2010/01/hsvmergepy.html I find replacing the entire intensity band always a bit harsh since for flat 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[0], hsv[1], v] ) Woud become something like: v_norm = v * hsv[2] / ( 255 * math.cos(zenith * (math.pi / 180.0))) hsv_adjusted = numpy.asarray( [hsv[0], hsv[1], 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. |
On 21-02-2012 14:11, Rutger wrote:
> Hey, > > > 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 space > and replace the intensity band (v) with your hillshade. This is for example > nicely shows at Franks blog: > http://fwarmerdam.blogspot.com/2010/01/hsvmergepy.html > http://fwarmerdam.blogspot.com/2010/01/hsvmergepy.html > > I find replacing the entire intensity band always a bit harsh since for flat > 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[0], hsv[1], v] )/ > > Woud become something like: > /v_norm = v * hsv[2] / ( 255 * math.cos(zenith * (math.pi / 180.0))) > hsv_adjusted = numpy.asarray( [hsv[0], hsv[1], 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. shading. Instead the shading is used to change the saturation of HSV making the facets facing illumination light become brighter and the other become darker. See for example http://gmt.soest.hawaii.edu/gmt/html/GMT_Docs.html#x1-1420007.17 and http://gmt.soest.hawaii.edu/gmt/html/GMT_Docs.html#x1-1580008.2 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 (..\gmt5\trunk\test\grdimage\orig\readwrite_withgdal.sh) Even simpler is to use Mirone. We can do the above just with a couple of clicks. Joaquim _______________________________________________ gdal-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/gdal-dev |
Hi Everyone
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 I need.
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 thanks
Tim On 21 February 2012 15:11, Joaquim Luis <[hidden email]> wrote:
_______________________________________________ gdal-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/gdal-dev |
> 5) Looked at GMT and I cannot find the options to load two rasters on > top of each other. Tim, You don't load the two grids on top of one-another. Illumination is NOT like transparency. It uses the gradients of the grid, projects it into the direction of light and than change the color in the HSV space (the S(aturation) component) and converts back to RGB The links that I sent you have the scripts used to produce the figures. You can also look at this one for a very simple illumination in bw, but the procedure for color illumination is exactly the same. http://gmt.soest.hawaii.edu/gmt/html/GMT_Docs.html#x1-1300007.5 > 6) MIRONE - again cannot see how to do this from within the application. Well, I can give you a 'click-recipe' if you want, but Mirone won't be able to deal with the such big grids as yours. Anyway, here is a step-by-step example https://sites.google.com/site/mironehowtos/basic/shade-illuminations _______________________________________________ gdal-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/gdal-dev |
Have you reviewed the article from Tim Sutton: "A workflow for creating beautiful relief shaded dems using GDAL"[1]?
It has some valuable pointers. Donovan On Tue, Feb 21, 2012 at 12:29 PM, Joaquim Luis <[hidden email]> wrote:
_______________________________________________ gdal-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/gdal-dev |
Hi Donovan and board
Yes that Tim Sutton tutorial is very good. I also found this one I ended up following this procedure and it has worked v well. I just setup a loop to use ImageMagik and combine the two images. And then reapplied the georeferencing using gdal_translate + world file.
Thanks to all helped, it has made me aware of lots of other options that I may use in the future thanks again Tim
On 21 February 2012 19:52, Donovan Cameron <[hidden email]> wrote:
_______________________________________________ gdal-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/gdal-dev |
On Feb 22, 2012, at 8:42 AM, tim martin wrote: Hi Donovan and board another option is ossim see Norman
_______________________________________________ gdal-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/gdal-dev |
Free forum by Nabble | Edit this page |