-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support multiple URLs/sources for vector tiles #58155
Conversation
@3nids , really happy about this one, it was literally less than two months ago that I had stumbled on this very issue. |
#if 0 | ||
// even if a feature has an internal ID, it's not guaranteed to be unique across different | ||
// tiles. This may violate the specifications, but it's been seen on mbtiles files in the wild... | ||
if ( feature.has_id() ) | ||
fid = static_cast<QgsFeatureId>( feature.id() ); | ||
else | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just remove this block altogether? Or Re-enable it the tiles size == 1 (i.e. when we only have one source)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@3nids any feedback on this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not added this ifdef. I dropped it.
@wonder-sk @troopa81 @nyalldawson @rouault do you have an opinion on this approach? |
Thank you for this, I am excited to see this land ! @nirvn are the latest updates ok for you? |
@m-kuhn , yep, I'm good with the latest updates. |
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
@3nids what is the status of this feature in regards of the docs? I've seen a series of mvt PRS but can't connect the points enough to tell if and what we could mention in docs... |
This is the one #58663 |
Thanks @3nids |
This is a draft/POC to allow a discussion.
Goal: rendering Mapbox Vector Tile layer having multiple sources
for instance: https://vectortiles.geo.admin.ch/styles/ch.swisstopo.basemap.vt/style.json
(see online: https://cms.geo.admin.ch/fmc/bm.html)
This cannot be solved by using several QGIS layers since the symbols ordering doesn't necessarily match with the layers/sources.
The idea is to allow listing several URLs in the layer. The rendering of each tile will be done at once when every source are fetched.
I have adapted
QgsVectorTileRawData
so that it contains a list ofQByteData
instead of a single one. The MVT decoder has been adapted accordingly.For the download algorithm I suppose we need to recombine the data into a single array.
The layer names are considered unique across sources. It might be necessary to map layer names to the proper source.
I have successfuly tested this for asynchronous tile fetching. Sync is implemented but not tested.
There is no UX yet to play with this, it will be done if the approach is accepted.
But here is a project to play with: mapbox-multi-sources.qgs.zip
Screenshot with the log of the 2 sources fetched:
Looking forward to read your thoughts :)