Skip to content
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 of different CRS than "EPSG:3857" or "EPSG:4326" #268

Open
arashgh-gh opened this issue Nov 27, 2019 · 4 comments
Open

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

arashgh-gh opened this issue Nov 27, 2019 · 4 comments

Comments

@arashgh-gh
Copy link

Hello,

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

Thanks

@mnboos
Copy link
Collaborator

mnboos commented Nov 28, 2019

Hello

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

@arashgh-gh
Copy link
Author

arashgh-gh commented Nov 28, 2019

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":

tile_bounds = get_tile_bounds(zoom=zoom, extent=bounds, scheme=scheme, source_crs="EPSG:4326")

lng, lat = convert_coordinate(source_crs=source_crs, target_crs="epsg:3857", lat=lat, lng=lng)

Or am I wrong?

@sfkeller
Copy link

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 .

@am2222
Copy link

am2222 commented Jan 21, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants