Vector-Tiles-Reader-QGIS-Plugin icon indicating copy to clipboard operation
Vector-Tiles-Reader-QGIS-Plugin copied to clipboard

Support of different CRS than "EPSG:3857" or "EPSG:4326"

Open arashgh-gh opened this issue 5 years ago • 4 comments

Hello,

Is it possible to load tiles in another crs for example "EPSG:25832" via this plugin?

Thanks

arashgh-gh avatar Nov 27 '19 14:11 arashgh-gh

Hello

I suggest you just give it a try and let me know ;-)

mnboos avatar Nov 28 '19 08:11 mnboos

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?

arashgh-gh avatar Nov 28 '19 10:11 arashgh-gh

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 .

sfkeller avatar Nov 28 '19 11:11 sfkeller

How can we set SRS in tilejson? Is it part of vector layer object?

am2222 avatar Jan 21 '20 04:01 am2222