Work-in-progress: Add support for projection using PROJ library >6.1#1331
Merged
lonvia merged 1 commit intoosm2pgsql-dev:masterfrom Nov 26, 2020
Merged
Work-in-progress: Add support for projection using PROJ library >6.1#1331lonvia merged 1 commit intoosm2pgsql-dev:masterfrom
lonvia merged 1 commit intoosm2pgsql-dev:masterfrom
Conversation
Collaborator
Author
|
See #922 |
13e98e0 to
4faefbf
Compare
This commit is adding projection support using the PROJ library from 6.1 onwards. The CMake config will prefer using the old API, simply because I don't know how to check for the new API without it trying to use the new API with version 5-6.0 which don't have everything we need. The code will only work from 6.1 onwards. There is a new CMake cache variable USE_PROJ_LIB which can be set to: * "4": Use version 4 API. Fail CMake if it is not available. * "6": Use version 6 API. Fail CMake if it is not available. * "off": Disable PROJ support (resulting binary will only have WGS84 (4326) and Web Mercator (3857) support) * "auto": Use version 4 API if available, otherwise try version 6 API or fall back to no PROJ support. Note that we have an issue with multithreading using the PROJ library, because we use it potentially from multiple threads. The information I can find about this seems to indicate that this is only a problem for error reporting, because of the error handling using a global errno-type variable. So we can't detect failed transformations reliably. But we don't care about those anyway in the code we have, so I believe this is probably not a huge problem. This affects the old and the new code, so this isn't something new. The API version 6 allows to do the multithreading correctly using a "context" which this commit does use. But the context is still shared between threads, because we are starting the threads after the reprojections have been initialized. So all of this is technically not correct, but we'll probably get away with it for the time being. We need larger refactorings in the geometry code anyway which we want to tackle soon and hopefully can resolve this correctly then. See osm2pgsql-dev#922
|
thank-you @joto for this |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a stab at adding projection support using the PROJ library from
6.1 onwards. There might be an issue with multithreading, but the old
code most likely already had that issue. This needs to be checked.
The CMake config will prefer using the old API, simply because I don't
know how to check for the new API without it trying to use the new API
with version 5-6.0 which don't have everything we need. The code will
only work from 6.1 onwards.