[Git][debian-gis-team/proj][upstream] New upstream version 9.3.0~rc2
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Wed Aug 30 19:39:38 BST 2023
Bas Couwenberg pushed to branch upstream at Debian GIS Project / proj
Commits:
f38b038e by Bas Couwenberg at 2023-08-30T20:29:53+02:00
New upstream version 9.3.0~rc2
- - - - -
4 changed files:
- src/iso19111/io.cpp
- src/iso19111/metadata.cpp
- src/proj_json_streaming_writer.cpp
- src/proj_json_streaming_writer.hpp
Changes:
=====================================
src/iso19111/io.cpp
=====================================
@@ -5981,7 +5981,7 @@ IdentifierNNPtr JSONParser::buildId(const json &j, bool removeInverseOf) {
static_cast<int>(dblVersion) == dblVersion) {
version = internal::toString(static_cast<int>(dblVersion));
} else {
- version = internal::toString(dblVersion);
+ version = internal::toString(dblVersion, /*precision=*/15);
}
} else {
throw ParsingException("Unexpected type for value of \"version\"");
=====================================
src/iso19111/metadata.cpp
=====================================
@@ -1088,10 +1088,11 @@ void Identifier::_exportToWKT(WKTFormatter *formatter) const {
formatter->addQuotedString(l_code);
}
if (!l_version.empty()) {
- try {
- (void)c_locale_stod(l_version);
+ bool isDouble = false;
+ (void)c_locale_stod(l_version, isDouble);
+ if (isDouble) {
formatter->add(l_version);
- } catch (const std::exception &) {
+ } else {
formatter->addQuotedString(l_version);
}
}
@@ -1140,16 +1141,11 @@ void Identifier::_exportToJSON(JSONFormatter *formatter) const {
if (!l_version.empty()) {
writer->AddObjKey("version");
- try {
- const double dblVersion = c_locale_stod(l_version);
- if (dblVersion >= std::numeric_limits<int>::min() &&
- dblVersion <= std::numeric_limits<int>::max() &&
- static_cast<int>(dblVersion) == dblVersion) {
- writer->Add(static_cast<int>(dblVersion));
- } else {
- writer->Add(dblVersion);
- }
- } catch (const std::exception &) {
+ bool isDouble = false;
+ (void)c_locale_stod(l_version, isDouble);
+ if (isDouble) {
+ writer->AddUnquoted(l_version.c_str());
+ } else {
writer->Add(l_version);
}
}
=====================================
src/proj_json_streaming_writer.cpp
=====================================
@@ -219,6 +219,11 @@ void CPLJSonStreamingWriter::Add(const char *pszStr) {
Print(FormatString(pszStr));
}
+void CPLJSonStreamingWriter::AddUnquoted(const char *pszStr) {
+ EmitCommaIfNeeded();
+ Print(pszStr);
+}
+
void CPLJSonStreamingWriter::Add(GIntBig nVal) {
EmitCommaIfNeeded();
Print(CPLSPrintf(CPL_FRMT_GIB, nVal));
=====================================
src/proj_json_streaming_writer.hpp
=====================================
@@ -86,6 +86,7 @@ class CPL_DLL CPLJSonStreamingWriter {
void Add(const std::string &str);
void Add(const char *pszStr);
+ void AddUnquoted(const char *pszStr);
void Add(bool bVal);
void Add(int nVal) { Add(static_cast<GIntBig>(nVal)); }
void Add(unsigned int nVal) { Add(static_cast<GIntBig>(nVal)); }
View it on GitLab: https://salsa.debian.org/debian-gis-team/proj/-/commit/f38b038e46440a4e92dffda7c856f939669dac59
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/proj/-/commit/f38b038e46440a4e92dffda7c856f939669dac59
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20230830/92efba23/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list