Replies: 4 comments 4 replies
-
I believe there are other links to maplibre spec related ideas of a similar issue/feature:
|
Beta Was this translation helpful? Give feedback.
-
There was also an idea to use a b&w image as an indicator of which tiles should have what zoom level. The idea being that a 1 bit image could have a pixel for each z14 tile, and have 0=z14, and 1=z15 -- i.e. an image would be 14^2 x 14^2 pixels in size. Or the image itself could be smaller than that, so each pixel would represent more than one tile (since most areas with high feature density is in one area. Or the image could be grayscale - and each pixel could be 2 bit or more, indicating the load level - e.g. 0=12, 1=14, 2=15, 3=16, or any other system. P.S. this would obviously just the client-side improvement, where the server (Martin) simply serves whatever it is being asked, but the client decides which zoom to request for which area |
Beta Was this translation helpful? Give feedback.
-
I'd go with a hybrid server/client solution. In broad terms, quite raw ideas:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Motivation
Most of the datasets the user might want to display on a map have sparse data. Even basemaps are quite crowded in city centers but mostly empty in the countryside or water areas. But, as the user zoom in, regardless of the amount of new information found in higher Z tiles, new tiles are requested, downloaded, parsed, and rendered. This causes an overhead on both the client and the server.
As an example, this map depicts the highest local LoD tile that contains at least 15 events
(Ref. 1)
The same applies to
flyTo
actions, where lower LoD would be more than welcome for the precaching and smoothing of the animation.So, to optimize network traffic and processing time, not every location should have the same LoD. In other words, the
maxzoom
should be dynamically set for each location depending on the data to be rendered there, as for some locations zooming in won't add new information or it's irrelevant for the user.This discussion is opened on Martin repo, but it might be cross to the clients repos.
The Starting discussion on Slack
Proposal
The amount of criteria to locally choose the right LoD is as large as the use cases you can think of, but maybe, we can narrow the possibilities to 3 generic possibilities:
(Ref. 2)
: using a 3rd dataset and a ruleset to set the max LoD. V.g.: City centers vs country-side(Ref. 3)
: using a ruleset that links KDE of each feature with the max LoD the container tile might reach, higher KDE -> higher LODSome thoughts on how to attack the required tasks
Client side
Now that the mixed LoD is (somehow) available in the client (at least in MapLibre GL JS)
(Ref. 4)
, the needed changes might include:a. YES
- Implement the rules logic
- Map the new requests
- No need for server changes
b. NO
- Add the logic to be able to request a zxy tile and flawlessly process a response with a z'x'y' tile instead, being z' <= z
- Memoizing! As every time a lower z is received (z') for a specific tile, it will affect 4^(z-z') requests for the sibling tiles
- The server should be aware of this feature and proxy the requests
IMHO, working on point 2.a is shooting us in the foot. The complexity, external dependencies, and performance hit might be huge. As an educated guess, only the 3rd approach could be performed client-side with a limited drop in performance.
Server Side
Starting point: the client request the usual zxy, and knows nothing about dynamic LoD
The 3 proposed approaches might be implemented server-side, more or less easily (using PostGIS, they are easy peasy tasks 😅 ).
Regardless of that, a new LoD proxy feature is needed to map the request for the expected zxy to a response containing a rule-compliant z'x'y' tile, and that new z'x'y' should be informed in the response' header so it can be processed accordingly clientside.
Data source preprocessing
Almost every tiler tool lets the user choose to limit the number of features or vertex per tile, that is a way to reduce the LoD based on zoom... not maxzoom, but minzoom. They looks for reducing the tile size for lower zooms by limiting the amount of information per tile. And this discussion is pointing the other side of the zoom scale 😄
Most of the work on the data itself could be achieved offline, with preprocessed datasets. But, anyway, the tiles mapping should be done somewhere. So we can rely on the server as a proxy... or push a change in the data format (MBTiles, PMTiles,...) ... that won't happen.
So, regardless of the data preprocessing, we still rely on the tile server as a proxy.
Conclussions
None, let's discuss! 😅
References
Beta Was this translation helpful? Give feedback.
All reactions