-
Notifications
You must be signed in to change notification settings - Fork 9
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
finding resource files #76
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This refers to the docs at https://proj.org/resource_files.html#where-are-proj-resource-files-looked-for.
We currently call
proj_context_set_search_paths
in__init__
to make it find theshare/proj
data that always comes with PROJ_jll. However ifproj_context_set_search_paths
is used then it doesn't look further down the documented location order: "If set, the next tests will not be run." I'm assuming that means it will stop there, whether the file is found or not.We probably don't need to call
proj_context_set_search_paths
in__init__
since the artifact uses the standard prefix layout so it should find it relative to the shared library at../share/proj/
. A benefit of not using it is that we will be open to users settingPROJ_DATA
, as well as looking in the PROJ user writable directory. Otherwise it needs to be explicitly added by users getting grids, as in #75 (comment).It can also be a conscious decision to keep the call to
proj_context_set_search_paths
in__init__
to isolate Proj.jl from system wide configuration settings, as it is now. I'm not sure how easy or common it is to break things based on these settings however. Though I'm not really looking forward to debugging user issues related to unintentional system wide configurations.If we want to keep things isolated from system wide settings by default, we should have a good julia specific location to write grids to with
projsync
. One option worth looking into would be to use https://github.com/JuliaPackaging/Scratch.jl for this, and then during__init__
add that to the search path:Proj.proj_context_set_search_paths(2, [Proj.PROJ_DATA[], scratch_dir])
. This does allow it to find grids you downloaded in previous julia sessions to the scratch dir, and any julia-specific bad resource state can be wiped usingclear_scratchspaces!(Proj)
.The text was updated successfully, but these errors were encountered: