StrandedKitty / streets-gl

🗺 OpenStreetMap 3D renderer powered by WebGL2
http://streets.gl
MIT License
657 stars 49 forks source link

Estimate tree height (part of #49) #138

Closed westnordost closed 1 year ago

westnordost commented 1 year ago

Estimate tree height based on est_height, crown_diameter, diameter or circumference if height is not available.

Also, correctly subtract min_height from height or est_height.

StrandedKitty commented 1 year ago

It looks fine, but can you please use ?? instead of || in case you need to add a fallback value to a number | undefined? In this particular case it probably doesn't matter, but this is just so that this code fits the general code style. Thank you.

Also, keep in mind that this code probably won't be used for long. I'm going to migrate to self-hosted tiles soon, and all the logic for handling tags on the frontend will get simplified as quite a lot of stuff can be parsed/calculated on the backend during the tile generation process. See https://github.com/StrandedKitty/planetiler

westnordost commented 1 year ago

and all the logic for handling tags on the frontend will get simplified as quite a lot of stuff can be parsed/calculated on the backend during the tile generation process. See https://github.com/StrandedKitty/planetiler

Is it really necessary to fork it? I would have thought that what gets put into the vector tiles would be configurable through some scriptable configuration. After all, pretty much every commercial vector tile service (MapTiler, Thunderforest, jawg.io, MapBox, ...) has a different schema with different names etc.

StrandedKitty commented 1 year ago

Is it really necessary to fork it? I would have thought that what gets put into the vector tiles would be configurable through some scriptable configuration. After all, pretty much every commercial vector tile service (MapTiler, Thunderforest, jawg.io, MapBox, ...) has a different schema with different names etc.

Existing schemas don't really suit 3D applications, they are meant for 2D rendering. In the readme of my fork there's a list of the most substancial changes that were made. It's not possible to implement them by just modifying some config.

StrandedKitty commented 1 year ago

@westnordost Thank you, I will transfer your height calculation logic to the Planetiler fork soon.