Skip to content

Commit

Permalink
proj_create(): do not open proj.db if string is a PROJ string, even i…
Browse files Browse the repository at this point in the history
…f proj_context_set_autoclose_database() has been set (fixes OSGeo#2734)
  • Loading branch information
rouault committed Jun 2, 2021
1 parent fdfeae1 commit 77de765
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/iso19111/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6944,7 +6944,12 @@ BaseObjectNNPtr createFromUserInput(const std::string &text, PJ_CONTEXT *ctx) {
DatabaseContextPtr dbContext;
try {
if (ctx != nullptr && ctx->cpp_context) {
dbContext = ctx->cpp_context->getDatabaseContext().as_nullable();
// Only connect to proj.db if needed
if (text.find("proj=") == std::string::npos ||
text.find("init=") != std::string::npos) {
dbContext =
ctx->cpp_context->getDatabaseContext().as_nullable();
}
}
} catch (const std::exception &) {
}
Expand Down

0 comments on commit 77de765

Please sign in to comment.