wmts tile as transparent overlay

377 views
Skip to first unread message

jan.gl...@gmail.com

unread,
Jan 10, 2016, 12:12:00 PM1/10/16
to GeoAdmin API
I just wonder if someone have a solution for this:

I'd like to overlay an map (e.g. ch.swisstopo.pixelkarte-grau) with the hillshading of ch.swisstopo.swissalti3d-reliefschattierung. I can set the opacity of the overlaying map to e.g. 0.5 but this is not the result I like. I'd like to have the black parts of hillshading map as black (and opaque), the white parts as absolut transparent (and the gray parts as black and 50% transparent). do you understand what I mean?

The tiles of ch.swisstopo.swissalti3d-reliefschattierung are .PNG so transparency would be possible. Do I get the tiles as black/transparent tiles?

and attached what my desired result (combined in photoshop)
map_hillshaded.png

Moullet Cédric swisstopo

unread,
Jan 11, 2016, 1:13:42 AM1/11/16
to geoadm...@googlegroups.com

Hello,

Without having tested, it should be possible to use an ol.source.Raster and to manage the pixels of the relief layer on the fly

See http://stackoverflow.com/questions/34149816/desaturate-tile-layer-in-openlayers-3  and http://openlayers.org/en/v3.12.1/examples/color-manipulation.html

I hope this helps,

Cédric  

 

De : geoadm...@googlegroups.com [mailto:geoadmin-a...@googlegroups.com] De la part de jan.gl...@gmail.com
Envoyé : dimanche 10 janvier 2016 18:12
À : GeoAdmin API <geoadm...@googlegroups.com>
Objet : wmts tile as transparent overlay

--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jan.gl...@gmail.com

unread,
Jan 11, 2016, 5:48:49 PM1/11/16
to GeoAdmin API, jan.gl...@gmail.com
thanks for the tip, it's working now, see here:
by the way: with the operation function I generate the hillshade with more contrast.

jan.gl...@gmail.com

unread,
Jan 12, 2016, 4:54:17 AM1/12/16
to GeoAdmin API, jan.gl...@gmail.com
just wonder if we can also blur the image/pixels. I found this:
do someone has an idea how this can be transleted to/with openlayers?
j


Am Sonntag, 10. Januar 2016 18:12:00 UTC+1 schrieb jan.gl...@gmail.com:

jan.gl...@gmail.com

unread,
Jan 12, 2016, 5:16:56 PM1/12/16
to GeoAdmin API
got it, if you are interested in check here:
it needs some time to calculated the blur (the bigger the matrix is the longer it takes...)
you can switch with the <>-button between blured and normal hillshading
j

Am Sonntag, 10. Januar 2016 18:12:00 UTC+1 schrieb jan.gl...@gmail.com:
Reply all
Reply to author
Forward
0 new messages