aboutsummaryrefslogtreecommitdiff
path: root/src/io.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-07 19:53:48 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-07 19:53:48 +0100
commit23127c01ad535902665a975da81e27c389bb7aeb (patch)
treed6cc90dfe1069425824de40fbe42342a1afca9bd /src/io.cpp
parent706fac8bc70312f5729e2f3aeeb4f67ecb211b1d (diff)
parent29b522b4b80b43fe03cb1a955789676eec8051e7 (diff)
downloadPROJ-23127c01ad535902665a975da81e27c389bb7aeb.tar.gz
PROJ-23127c01ad535902665a975da81e27c389bb7aeb.zip
Merge remote-tracking branch 'rouault/gdalbarn'
Diffstat (limited to 'src/io.cpp')
-rw-r--r--src/io.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/io.cpp b/src/io.cpp
index f396f1df..b5da2b8c 100644
--- a/src/io.cpp
+++ b/src/io.cpp
@@ -490,7 +490,7 @@ static std::string normalizeSerializedString(const std::string &in) {
return in;
}
#else
-static std::string normalizeSerializedString(const std::string &in) {
+static inline std::string normalizeSerializedString(const std::string &in) {
return in;
}
#endif
@@ -499,11 +499,19 @@ static std::string normalizeSerializedString(const std::string &in) {
void WKTFormatter::add(double number, int precision) {
d->startNewChild();
- std::string val(
- normalizeSerializedString(internal::toString(number, precision)));
- d->result_ += val;
- if (d->params_.useESRIDialect_ && val.find('.') == std::string::npos) {
- d->result_ += ".0";
+ if (number == 0.0) {
+ if (d->params_.useESRIDialect_) {
+ d->result_ += "0.0";
+ } else {
+ d->result_ += '0';
+ }
+ } else {
+ std::string val(
+ normalizeSerializedString(internal::toString(number, precision)));
+ d->result_ += val;
+ if (d->params_.useESRIDialect_ && val.find('.') == std::string::npos) {
+ d->result_ += ".0";
+ }
}
}
@@ -1963,8 +1971,7 @@ GeodeticReferenceFrameNNPtr WKTParser::Private::buildGeodeticReferenceFrame(
foundDatumName = true;
properties.set(IdentifiedObject::NAME_KEY,
refDatum->nameStr());
- if (properties.find(Identifier::CODESPACE_KEY) ==
- properties.end() &&
+ if (!properties.get(Identifier::CODESPACE_KEY) &&
refDatum->identifiers().size() == 1) {
const auto &id = refDatum->identifiers()[0];
auto identifiers = ArrayOfBaseObject::create();
@@ -6674,7 +6681,7 @@ CRSNNPtr PROJStringParser::Private::buildProjectedCRS(
} else if (step.name == "krovak") {
if (param->epsg_code ==
EPSG_CODE_PARAMETER_COLATITUDE_CONE_AXIS) {
- value = 30.2881397222222;
+ value = 30.28813975277777776;
} else if (
param->epsg_code ==
EPSG_CODE_PARAMETER_LATITUDE_PSEUDO_STANDARD_PARALLEL) {