Skip to content

Commit

Permalink
Merge pull request #2735 from rouault/fix_2734
Browse files Browse the repository at this point in the history
proj_create(): do not open proj.db if string is a PROJ string, …
  • Loading branch information
rouault authored Jun 2, 2021
2 parents fdfeae1 + 77de765 commit a77df0d
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 a77df0d

Please sign in to comment.