felixpalmer / procedural-gl-js

Mobile-first 3D mapping engine with emphasis on user experience
https://www.procedural.eu/map
Mozilla Public License 2.0
1.29k stars 84 forks source link

Adjustable zoom cap for terrain tiles #24

Closed hermanmitish closed 3 years ago

hermanmitish commented 3 years ago

Hi, @felixpalmer! First of all big thanks and congratulations on an amazing library! The recent update, which provides API for custom terrain tilesources was exactly what our project needed so much! A bit of the background on how we try to use your library - our project aims to visualize the changes that happened to the landscape of one of the Kyiv districts, in Ukraine, throughout the 20 century and until now (in the area where the Holocaust massacre happened during the WW2, which is the focus of our research investigation).

For this, we have prepared custom rgb tile-sources of high resolution (max zoom level in our terrain tilesets is 18, tilesize is standard 512x512), for different years. However, we noticed that the library caps the max zoom level of the tile-source (fetching happens for the 10th zoom level at the max), this way preventing the landscape to render in a higher detail at the close-ups. Is it possible to configure the max zoom of the tileset in any way? E.g. as a part of the datasource configuration? Maybe it could be configured similarly to how this is specified in the tilejson specs, with 'maxzoom' and 'minzoom' properties? Thank you very much for your answer in advance!

image

felixpalmer commented 3 years ago

Hi @germanmitish, sounds like a fascinating project. You are correct, there is currently a hardcoded limit for the max zoom, which was done to enable the entire world to fit into a single texture, which is likely overkill for most purposes. However it kept the code simpler and faster and enabled me to release it on time. As such, raising the max zoom level isn't quite as simple as just changing a parameter.

Is it correct that the max zoom you have for the terrain is really level 18? That seems very high, better than 1m resolution. Could you share how large an area you would need to cover at this zoom level? From your screenshot it appears that you only visualizing a limited area.

I agree it would be good to add minzoom/maxzoom properties to the tile source definitions. I hope to get to this at some point (I prioritize requests from sponsors 😉) - not least because it would be great to see how the experience would look for a high-resolution terrain datasource.

hermanmitish commented 3 years ago

Hi and thanks for your reply!

Regarding the max zoom level - our area of investigation fits loosely in the square with 2.8km side, but some smaller sub-areas within it have more detail over the others. Anyways, maybe 18th zoom is a bit too much, and 16 seem to be ok to do the job too, but we can be sure only when we try it :) The detailing level comes from our available historical documentation, so at least for the imagery tiles with those documents we use it that high.

I will ask our research group to look into possibilities to sponsor the project, as it seems to be really cool and we would potentially be interested in some of the other features, that we saw proposed in your issues, e.g. integration with 3d models. I would also be happy to help with development, however, I am afraid I do not possess the necessary level of expertise in WebGL just yet. But, I would be happy to help with testing if needed!

felixpalmer commented 3 years ago

maxZoom has now been added to the datasource definition and the library updated to handle elevation data at higher zoom levels than 10. See https://github.com/felixpalmer/procedural-gl-js/wiki/Data-sources

So you should be able to pull in your higher resolution data now

hermanmitish commented 3 years ago

Thank you so much, this is exciting!