OSM2World icon indicating copy to clipboard operation
OSM2World copied to clipboard

Rendering trees' circumference

Open ivanbranco opened this issue 1 year ago • 3 comments

Do you think it could be possible to use circumference=* to better render trees? Currently, tree rendering isn't well-supported in the OSM world, and it would be great to have more support.

Using circumference=* could also help estimate tree sizes (link). Right now, only height=* is used, but measuring tree height is far less simple than measuring their circumference.

ivanbranco avatar Jul 11 '24 10:07 ivanbranco

Thank you for the suggestion and the link! Yes, this would be reasonably easy to implement – with the limitation that more complex combinations of parameters (e.g. varying trunk diameter and crown diameter independently) would require more sophisticated tree models than what OSM2World is currently using.

It would be straightforward to use circumference to estimate height, and it should also be possible to scale width and height independently if both kinds of tags are provided.

Do you know where the ratios between crown diameter, trunk diameter and height assumed in the linked code come from?

tordanik avatar Jul 11 '24 16:07 tordanik

Do you know where the ratios between crown diameter, trunk diameter and height assumed in the linked code come from?

Not really, tagging @westnordost in case he wants to share more about it.

ivanbranco avatar Jul 12 '24 12:07 ivanbranco

I don't remember.

westnordost avatar Jul 12 '24 15:07 westnordost

Since 73c61ad, OSM2World supports circumference, diameter and diameter_crown for trees. This works for individual trees and groups of trees (such as natural=tree_row).

If both crown diameter and height are known, both are taken into account to scale the tree horizontally and vertically, respectively. If one of these values is missing, it is estimated based on the other value.

The default trees based on an image texture don't allow varying trunk diameter and crown diameter independently, but the code supports this for models which use 3D geometry instead of textures to represent a tree.

tordanik avatar Nov 18 '24 09:11 tordanik