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 multiple data directories in PROJ_LIB env variable #1150

Closed
wonder-sk opened this issue Oct 11, 2018 · 4 comments
Closed

Support multiple data directories in PROJ_LIB env variable #1150

wonder-sk opened this issue Oct 11, 2018 · 4 comments

Comments

@wonder-sk
Copy link
Contributor

When working with 3rd party datum shift grid files, they need to be copied to the directory recognized by proj library which can be set by PROJ_LIB environment variable. The problem is that typically this directory (e.g. /usr/share/proj) is read-only for ordinary users. As a result, it is difficult for users to use such grid files.

If we had support for multiple directories in PROJ_LIB, we could also take into account some directory in the user's home folder and so it would lower the barrier for users to install extra grid files (e.g. there could be QGIS plugin to download them - or even built-in functionality in QGIS).

@kbevers
Copy link
Member

kbevers commented Oct 11, 2018

This is a good idea! I'm happy to accept a pull request implementing this.

@wonder-sk
Copy link
Contributor Author

Looking more into proj API, it is actually possible to use multiple paths by setting own "finder" with pj_set_finder() or by setting a list of search paths with pj_set_searchpath(). Both of these are however marked in the API documentation as deprecated. So I am wondering what is the plan... Are they going to be removed completely? Or are they going to be replaced by similar calls using the new proj_* prefix?

If they are going to stay, it is probably easier for apps like QGIS to use pj_set_finder() or pj_set_searchpath() than adjusting PROJ_LIB env variable...

@kbevers
Copy link
Member

kbevers commented Oct 13, 2018

If they are useful to you we can move them into the proj_ namespace. So far we have tried to keep it to a minimum to find out which functions are in use out there.

@wonder-sk
Copy link
Contributor Author

I think we need a means to specify multiple paths for proj resource files, but I do not have a strong opinion how exactly that should work. If I could choose, I would probably go with something like this:

  • there is a list of directories that get searched - probably per PJ_CONTEXT rather than global (?)
  • client can retrieve or modify the list of search directories
  • on proj initialization, the list is initialized from PROJ_LIB env var - or if not provided then from a hardcoded default like /usr/share/proj

This should give enough flexibility and it should simplify the search logic (which is currently 1. try pj_finder, 2. try PROJ_LIB, 3. try search paths) to just simple traversal of search paths.

rouault added a commit to rouault/PROJ that referenced this issue Jan 9, 2019
rouault added a commit to rouault/PROJ that referenced this issue Jan 9, 2019
rouault added a commit to rouault/PROJ that referenced this issue Jan 9, 2019
rouault added a commit to rouault/PROJ that referenced this issue Jan 9, 2019
@kbevers kbevers closed this as completed in 03b8e99 Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants