Vector-Tiles-Reader-QGIS-Plugin
Vector-Tiles-Reader-QGIS-Plugin copied to clipboard
Support of different CRS than "EPSG:3857" or "EPSG:4326"
Hello,
Is it possible to load tiles in another crs for example "EPSG:25832" via this plugin?
Thanks
Hello
I suggest you just give it a try and let me know ;-)
Hi,
actually I had tried it before asking the question but I wanted to be sure if it is basically possible. :)
I was a little bit confused. I use T-rex vector tiles server to produce my grid and .pbf data in "EPSG:25832" and visualize them in OpenLayers. I took the folder of my cached tiles and tried to open it via your plugin in QGIS. I have just recognised that my cached tiles are in "EPSG:3857" and not in "EPSG:25832".
First, I tried to adjust my metadata.json to have "EPSG:25832" but I got error that lat lon is out of range. Then I changed to the original metadata.json, where I got the error "tolerance condition error" again. I have just read that the Google Mercator projection is only valid between +/- 85.0511 degrees North/South and I had the following condition in my metadata "bounds":"[-180.0,-90.0,180.0,90.0]"
. So I changed it to "bounds":"[-180.0,-89.9998,180.0,83.6338]"
and it was loaded without any error! It works and thanks for the plugin!
But going back to the question if it is possible to load tiles in "EPSG:25832". I think it is not possible, because the plugin assumes that the source crs is always "EPSG:4326" and converts it to "EPSG:3857":
https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin/blob/b35c7e6cfabf5a27aab69f9370647c1e94364f6a/plugin/util/tile_json.py#L76
https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin/blob/b35c7e6cfabf5a27aab69f9370647c1e94364f6a/plugin/util/tile_helper.py#L142
Or am I wrong?
MBGL Spec. leaves it open which CRS. Mapbox (MB) tools though implement 4326 only. An this plugin completely relies on MB implementations.
Just FYI: There are some "tricks" (and implementations) needed in order to support other CRS than 4326. See e.g. this presentations at SotM 2019 https://www.youtube.com/watch?v=GELhDZLtSMI .
How can we set SRS in tilejson? Is it part of vector layer object?