aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-01-05 16:49:21 +0100
committerEven Rouault <even.rouault@spatialys.com>2021-01-05 16:49:56 +0100
commit93d8fccd51a704c4accd535743a963ad0ca5a274 (patch)
tree5b4868ad6804afdc8f7a616c04c096bbf61bd0f3 /src/iso19111
parent367771f4bae20698c0740c7dd469a5b10bc28673 (diff)
downloadPROJ-93d8fccd51a704c4accd535743a963ad0ca5a274.tar.gz
PROJ-93d8fccd51a704c4accd535743a963ad0ca5a274.zip
createFromUserInput(): accept leading white space (fixes #2498)
Diffstat (limited to 'src/iso19111')
-rw-r--r--src/iso19111/io.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp
index dc51c5d9..c0844608 100644
--- a/src/iso19111/io.cpp
+++ b/src/iso19111/io.cpp
@@ -6132,6 +6132,12 @@ static BaseObjectNNPtr createFromUserInput(const std::string &text,
const DatabaseContextPtr &dbContext,
bool usePROJ4InitRules,
PJ_CONTEXT *ctx) {
+ std::size_t idxFirstCharNotSpace = text.find_first_not_of(" \t\r\n");
+ if (idxFirstCharNotSpace > 0 && idxFirstCharNotSpace != std::string::npos) {
+ return createFromUserInput(text.substr(idxFirstCharNotSpace), dbContext,
+ usePROJ4InitRules, ctx);
+ }
+
if (!text.empty() && text[0] == '{') {
json j;
try {