kekscom / osmbuildings

OSM Buildings Classic 2.5D
http://osmbuildings.org
BSD 2-Clause "Simplified" License
505 stars 140 forks source link

Marker change when in shadow #109

Closed jclevenne closed 6 years ago

jclevenne commented 6 years ago

Hello

Thank you so much for providing such a great map. Is it possible to know (by a function or other) if a specific geographical point at a specific date and time is in the shadow or in the sun? My goal is to change the color of a marker when this one is in the sunlight or under the shade of the buildings.

Thanks for your invaluable support!

kekscom commented 6 years ago

Hi, Maybe that is possible but would go far beyond scope. A hack would be reading shadow layer pixel by pixel and doing some tests. Alternative is this one from our drawer: https://github.com/OSMBuildings/pg-shadows Calculates shadows in PostGIS.

jclevenne commented 6 years ago

Thank you! I succeeded using the method getImageData in the way you suggested (reading pixel by pixel on shadow layer). Next step in my project will be to include elevation data below building layer. But this is another subject...

kekscom commented 6 years ago

Glad it helped. If there is a chance to share your solution, please do. Cheers