Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Custom Projection #6554

Closed
bessermt opened this issue Oct 2, 2016 · 8 comments
Closed

Custom Projection #6554

bessermt opened this issue Oct 2, 2016 · 8 comments
Labels
Core The cross-platform C++ core, aka mbgl

Comments

@bessermt
Copy link

bessermt commented Oct 2, 2016

I would like to write my own custom projection code to replace the Mercator projection. I can't see how this can be done with the current code. Is this possible? If not, how can this feature be added?

@ryanbaumann
Copy link

ryanbaumann commented Oct 3, 2016

Hi @bessermt, can you project your source data? Mapbox GL JS maps use the Web Mercator coordinate system EPSG:3857.

PROJ4 is a popular library for coordinate transformations. it has JS bindings, as well as bindings for other languages. The client or the server could perform the projection from the source coordinate system to EPSG:3857.

@tmcw
Copy link
Contributor

tmcw commented Oct 3, 2016

Going to guess that this is about display projections, not projections in data. Mapbox GL Native supports the Mercator projection only. There's a PR (closed for inactivity) and an issue in GL JS for this feature, and the maintainer opinion is that we'd accept a PR.

@mitch-besser
Copy link

I can't use JS, AFAIK. My app will have no Internet connection and I assume the JS requires that. ??? The point is to not project the data, but to use a different map projection. The tiles are not in Mercator intentionally and changing them is not allowed. There are many uses for custom map projections, not the least of which is games. From what I can see, exposing the projection would be super easy to code, only requiring 2 functions to use a callbacks instead of direct calls. Current users would see no changes to existing code. Unbelievably simple, extremely useful, but not done. Seems very strange that custom projections are not supported. Google supports them, but only in their JS version. This would allow a jump ahead of Google if that matters.

@tmcw
Copy link
Contributor

tmcw commented Oct 6, 2016

Unbelievably simple, extremely useful, but not done.

Please refrain from evaluating the technical difficulty of this work, especially in a larger system. There are very valid reasons why projections are not supported more broadly, on a product (you can't mix projections), standards (no standard scale sets) and performance (on-the-fly reprojection) dimensions. Or, if you're confident that it is a two-line fix, then we're happy to accept a pull request.

@mitch-besser
Copy link

I never claimed it was a 2 line fix. I did say it was a 2 function fix. Yes, simple. Is this not the place to make change requests?

@tmcw
Copy link
Contributor

tmcw commented Oct 6, 2016

Yep, this is the place you can submit a pull request, through the normal GitHub flow, and see the contributing documentation to get started.

@mitch-besser
Copy link

Not a pull request, a change request.

@friedbunny friedbunny added the Core The cross-platform C++ core, aka mbgl label Mar 10, 2017
@myarjunar
Copy link

myarjunar commented Jan 22, 2019

PROJ4 is a popular library for coordinate transformations. it has JS bindings, as well as bindings for other languages. The client or the server could perform the projection from the source coordinate system to EPSG:3857.

Could this be the way to enable custom projection in mapbox-gl-native? By using PROJ4? If so, I would like to contribute to add this feature utilizing PROJ4 lib.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

6 participants