aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-09-04 15:46:13 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-09-08 11:11:03 +0200
commit024f63731283c0026ad5b4dea4084bc48bbcc6f7 (patch)
tree7264a3e7c9f5388a537d0d4dbb31bbeceea720b0 /src
parentfaf7ec2d7f5d489bfd187f1a3408f0f09f94282f (diff)
downloadPROJ-024f63731283c0026ad5b4dea4084bc48bbcc6f7.tar.gz
PROJ-024f63731283c0026ad5b4dea4084bc48bbcc6f7.zip
Use in API and utilities WKT2_2019 instead of WKT2_2018 (fixes #1518)
- C API: PJ_GUESSED_WKT2_2019 is added, PJ_GUESSED_WKT2_2018 aliased to it - C API: PJ_WKT2_2019[_SIMPLIFIED] is added, PJ_WKT2_2018[_SIMPLIFIED] alias to it - C++ API: similarly for WKTFormatter::Convention::WKT2_2019[_SIMPLIFIED] Those above changes should be fully backward API and ABI compatible. projinfo changes: - accept WKT2_2019 as value for -o switch. WKT2_2018 is still accepted (undocumented) - output now uses 'WKT2_2019 string:', so might break scripts that would rely on that. Other internal code references to WKT2_2018 changes to WKT2_2019, included in tests.
Diffstat (limited to 'src')
-rw-r--r--src/apps/projinfo.cpp80
-rw-r--r--src/general_doc.dox2
-rw-r--r--src/iso19111/c_api.cpp12
-rw-r--r--src/iso19111/common.cpp4
-rw-r--r--src/iso19111/coordinateoperation.cpp16
-rw-r--r--src/iso19111/coordinatesystem.cpp14
-rw-r--r--src/iso19111/crs.cpp34
-rw-r--r--src/iso19111/datum.cpp10
-rw-r--r--src/iso19111/io.cpp44
-rw-r--r--src/proj.h19
10 files changed, 127 insertions, 108 deletions
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp
index 1d75efa6..ba9e8350 100644
--- a/src/apps/projinfo.cpp
+++ b/src/apps/projinfo.cpp
@@ -61,8 +61,8 @@ namespace { // anonymous namespace
struct OutputOptions {
bool quiet = false;
bool PROJ5 = false;
- bool WKT2_2018 = false;
- bool WKT2_2018_SIMPLIFIED = false;
+ bool WKT2_2019 = false;
+ bool WKT2_2019_SIMPLIFIED = false;
bool WKT2_2015 = false;
bool WKT2_2015_SIMPLIFIED = false;
bool WKT1_GDAL = false;
@@ -101,8 +101,8 @@ static void usage() {
<< std::endl;
std::cerr << std::endl;
std::cerr << "-o: formats is a comma separated combination of: "
- "all,default,PROJ,WKT_ALL,WKT2_2015,WKT2_2018,WKT1_GDAL,"
- "WKT1_ESRI,PROJJSON"
+ "all,default,PROJ,WKT_ALL,WKT2:2015,WKT2:2019,WKT1:GDAL,"
+ "WKT1:ESRI,PROJJSON"
<< std::endl;
std::cerr << " Except 'all' and 'default', other format can be preceded "
"by '-' to disable them"
@@ -309,7 +309,7 @@ static void outputObject(
std::cout << std::endl;
}
if (!outputOpt.quiet) {
- std::cout << "WKT2_2015 string:" << std::endl;
+ std::cout << "WKT2:2015 string:" << std::endl;
}
auto formatter =
WKTFormatter::create(WKTFormatter::Convention::WKT2_2015);
@@ -323,7 +323,7 @@ static void outputObject(
}
std::cout << wkt << std::endl;
} catch (const std::exception &e) {
- std::cerr << "Error when exporting to WKT2_2015: " << e.what()
+ std::cerr << "Error when exporting to WKT2:2015: " << e.what()
<< std::endl;
}
alreadyOutputed = true;
@@ -335,7 +335,7 @@ static void outputObject(
std::cout << std::endl;
}
if (!outputOpt.quiet) {
- std::cout << "WKT2_2015_SIMPLIFIED string:" << std::endl;
+ std::cout << "WKT2:2015_SIMPLIFIED string:" << std::endl;
}
auto formatter = WKTFormatter::create(
WKTFormatter::Convention::WKT2_2015_SIMPLIFIED);
@@ -349,22 +349,22 @@ static void outputObject(
}
std::cout << wkt << std::endl;
} catch (const std::exception &e) {
- std::cerr << "Error when exporting to WKT2_2015_SIMPLIFIED: "
+ std::cerr << "Error when exporting to WKT2:2015_SIMPLIFIED: "
<< e.what() << std::endl;
}
alreadyOutputed = true;
}
- if (outputOpt.WKT2_2018) {
+ if (outputOpt.WKT2_2019) {
try {
if (alreadyOutputed) {
std::cout << std::endl;
}
if (!outputOpt.quiet) {
- std::cout << "WKT2_2018 string:" << std::endl;
+ std::cout << "WKT2:2019 string:" << std::endl;
}
auto formatter =
- WKTFormatter::create(WKTFormatter::Convention::WKT2_2018);
+ WKTFormatter::create(WKTFormatter::Convention::WKT2_2019);
if (outputOpt.singleLine) {
formatter->setMultiLine(false);
}
@@ -375,22 +375,22 @@ static void outputObject(
}
std::cout << wkt << std::endl;
} catch (const std::exception &e) {
- std::cerr << "Error when exporting to WKT2_2018: " << e.what()
+ std::cerr << "Error when exporting to WKT2:2019: " << e.what()
<< std::endl;
}
alreadyOutputed = true;
}
- if (outputOpt.WKT2_2018_SIMPLIFIED) {
+ if (outputOpt.WKT2_2019_SIMPLIFIED) {
try {
if (alreadyOutputed) {
std::cout << std::endl;
}
if (!outputOpt.quiet) {
- std::cout << "WKT2_2018_SIMPLIFIED string:" << std::endl;
+ std::cout << "WKT2:2019_SIMPLIFIED string:" << std::endl;
}
auto formatter = WKTFormatter::create(
- WKTFormatter::Convention::WKT2_2018_SIMPLIFIED);
+ WKTFormatter::Convention::WKT2_2019_SIMPLIFIED);
if (outputOpt.singleLine) {
formatter->setMultiLine(false);
}
@@ -401,7 +401,7 @@ static void outputObject(
}
std::cout << wkt << std::endl;
} catch (const std::exception &e) {
- std::cerr << "Error when exporting to WKT2_2018_SIMPLIFIED: "
+ std::cerr << "Error when exporting to WKT2:2019_SIMPLIFIED: "
<< e.what() << std::endl;
}
alreadyOutputed = true;
@@ -413,7 +413,7 @@ static void outputObject(
std::cout << std::endl;
}
if (!outputOpt.quiet) {
- std::cout << "WKT1_GDAL:" << std::endl;
+ std::cout << "WKT1:GDAL string:" << std::endl;
}
auto crs = nn_dynamic_pointer_cast<CRS>(obj);
@@ -440,7 +440,7 @@ static void outputObject(
std::cout << wkt << std::endl;
std::cout << std::endl;
} catch (const std::exception &e) {
- std::cerr << "Error when exporting to WKT1_GDAL: " << e.what()
+ std::cerr << "Error when exporting to WKT1:GDAL: " << e.what()
<< std::endl;
}
alreadyOutputed = true;
@@ -452,7 +452,7 @@ static void outputObject(
std::cout << std::endl;
}
if (!outputOpt.quiet) {
- std::cout << "WKT1_ESRI:" << std::endl;
+ std::cout << "WKT1:ESRI string:" << std::endl;
}
auto formatter = WKTFormatter::create(
@@ -465,7 +465,7 @@ static void outputObject(
std::cout << wkt << std::endl;
std::cout << std::endl;
} catch (const std::exception &e) {
- std::cerr << "Error when exporting to WKT1_ESRI: " << e.what()
+ std::cerr << "Error when exporting to WKT1:ESRI: " << e.what()
<< std::endl;
}
alreadyOutputed = true;
@@ -745,14 +745,14 @@ int main(int argc, char **argv) {
for (auto format : formats) {
if (ci_equal(format, "all")) {
outputOpt.PROJ5 = true;
- outputOpt.WKT2_2018 = true;
+ outputOpt.WKT2_2019 = true;
outputOpt.WKT2_2015 = true;
outputOpt.WKT1_GDAL = true;
outputOpt.WKT1_ESRI = true;
outputOpt.PROJJSON = true;
} else if (ci_equal(format, "default")) {
outputOpt.PROJ5 = true;
- outputOpt.WKT2_2018 = true;
+ outputOpt.WKT2_2019 = true;
outputOpt.WKT2_2015 = false;
outputOpt.WKT1_GDAL = false;
} else if (ci_equal(format, "PROJ")) {
@@ -761,26 +761,38 @@ int main(int argc, char **argv) {
outputOpt.PROJ5 = false;
} else if (ci_equal(format, "WKT_ALL") ||
ci_equal(format, "WKT-ALL")) {
- outputOpt.WKT2_2018 = true;
+ outputOpt.WKT2_2019 = true;
outputOpt.WKT2_2015 = true;
outputOpt.WKT1_GDAL = true;
} else if (ci_equal(format, "-WKT_ALL") ||
ci_equal(format, "-WKT-ALL")) {
- outputOpt.WKT2_2018 = false;
+ outputOpt.WKT2_2019 = false;
outputOpt.WKT2_2015 = false;
outputOpt.WKT1_GDAL = false;
- } else if (ci_equal(format, "WKT2_2018") ||
+ } else if (ci_equal(format, "WKT2_2019") ||
+ ci_equal(format, "WKT2-2019") ||
+ ci_equal(format, "WKT2:2019") ||
+ /* legacy: undocumented */
+ ci_equal(format, "WKT2_2018") ||
ci_equal(format, "WKT2-2018") ||
ci_equal(format, "WKT2:2018")) {
- outputOpt.WKT2_2018 = true;
- } else if (ci_equal(format, "WKT2_2018_SIMPLIFIED") ||
+ outputOpt.WKT2_2019 = true;
+ } else if (ci_equal(format, "WKT2_2019_SIMPLIFIED") ||
+ ci_equal(format, "WKT2-2019_SIMPLIFIED") ||
+ ci_equal(format, "WKT2:2019_SIMPLIFIED") ||
+ /* legacy: undocumented */
+ ci_equal(format, "WKT2_2018_SIMPLIFIED") ||
ci_equal(format, "WKT2-2018_SIMPLIFIED") ||
ci_equal(format, "WKT2:2018_SIMPLIFIED")) {
- outputOpt.WKT2_2018_SIMPLIFIED = true;
- } else if (ci_equal(format, "-WKT2_2018") ||
+ outputOpt.WKT2_2019_SIMPLIFIED = true;
+ } else if (ci_equal(format, "-WKT2_2019") ||
+ ci_equal(format, "-WKT2-2019") ||
+ ci_equal(format, "-WKT2:2019") ||
+ /* legacy: undocumented */
+ ci_equal(format, "-WKT2_2018") ||
ci_equal(format, "-WKT2-2018") ||
ci_equal(format, "-WKT2:2018")) {
- outputOpt.WKT2_2018 = false;
+ outputOpt.WKT2_2019 = false;
} else if (ci_equal(format, "WKT2_2015") ||
ci_equal(format, "WKT2-2015") ||
ci_equal(format, "WKT2:2015")) {
@@ -1027,11 +1039,11 @@ int main(int argc, char **argv) {
if (!outputSwithSpecified) {
outputOpt.PROJ5 = true;
- outputOpt.WKT2_2018 = true;
+ outputOpt.WKT2_2019 = true;
}
if (outputOpt.quiet &&
- (outputOpt.PROJ5 + outputOpt.WKT2_2018 + outputOpt.WKT2_2015 +
+ (outputOpt.PROJ5 + outputOpt.WKT2_2019 + outputOpt.WKT2_2015 +
outputOpt.WKT1_GDAL + outputOpt.PROJJSON) != 1) {
std::cerr << "-q can only be used with a single output format"
<< std::endl;
@@ -1046,8 +1058,8 @@ int main(int argc, char **argv) {
if (guessDialect) {
auto dialect = WKTParser().guessDialect(user_string);
std::cout << "Guessed WKT dialect: ";
- if (dialect == WKTParser::WKTGuessedDialect::WKT2_2018) {
- std::cout << "WKT2_2018";
+ if (dialect == WKTParser::WKTGuessedDialect::WKT2_2019) {
+ std::cout << "WKT2_2019";
} else if (dialect == WKTParser::WKTGuessedDialect::WKT2_2015) {
std::cout << "WKT2_2015";
} else if (dialect == WKTParser::WKTGuessedDialect::WKT1_GDAL) {
diff --git a/src/general_doc.dox b/src/general_doc.dox
index 9962e8df..0684db11 100644
--- a/src/general_doc.dox
+++ b/src/general_doc.dox
@@ -102,7 +102,7 @@ definitions, and coordinate operations. This is an implementation of
PROJ implements the two following revisions of the standard:
-\subsubsection WKT2_2018 WKT2:2018 / WKT2:2019
+\subsubsection WKT2_2019 WKT2:2019
[OGC 18-010r7, 2019-06-24, WKT2-2019]
(http://docs.opengeospatial.org/is/18-010r7/18-010r7.html)
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index 312daeab..53cfa31e 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -360,8 +360,8 @@ PJ_GUESSED_WKT_DIALECT proj_context_guess_wkt_dialect(PJ_CONTEXT *ctx,
(void)ctx;
assert(wkt);
switch (WKTParser().guessDialect(wkt)) {
- case WKTParser::WKTGuessedDialect::WKT2_2018:
- return PJ_GUESSED_WKT2_2018;
+ case WKTParser::WKTGuessedDialect::WKT2_2019:
+ return PJ_GUESSED_WKT2_2019;
case WKTParser::WKTGuessedDialect::WKT2_2015:
return PJ_GUESSED_WKT2_2015;
case WKTParser::WKTGuessedDialect::WKT1_GDAL:
@@ -1308,10 +1308,10 @@ const char *proj_as_wkt(PJ_CONTEXT *ctx, const PJ *obj, PJ_WKT_TYPE type,
return WKTFormatter::Convention::WKT2_2015;
case PJ_WKT2_2015_SIMPLIFIED:
return WKTFormatter::Convention::WKT2_2015_SIMPLIFIED;
- case PJ_WKT2_2018:
- return WKTFormatter::Convention::WKT2_2018;
- case PJ_WKT2_2018_SIMPLIFIED:
- return WKTFormatter::Convention::WKT2_2018_SIMPLIFIED;
+ case PJ_WKT2_2019:
+ return WKTFormatter::Convention::WKT2_2019;
+ case PJ_WKT2_2019_SIMPLIFIED:
+ return WKTFormatter::Convention::WKT2_2019_SIMPLIFIED;
case PJ_WKT1_GDAL:
return WKTFormatter::Convention::WKT1_GDAL;
case PJ_WKT1_ESRI:
diff --git a/src/iso19111/common.cpp b/src/iso19111/common.cpp
index f375ea0a..d7960ee9 100644
--- a/src/iso19111/common.cpp
+++ b/src/iso19111/common.cpp
@@ -989,7 +989,7 @@ void ObjectDomain::_exportToWKT(WKTFormatter *formatter) const {
formatter->startNode(WKTConstants::SCOPE, false);
formatter->addQuotedString(*(d->scope_));
formatter->endNode();
- } else if (formatter->use2018Keywords()) {
+ } else if (formatter->use2019Keywords()) {
formatter->startNode(WKTConstants::SCOPE, false);
formatter->addQuotedString("unknown");
formatter->endNode();
@@ -1192,7 +1192,7 @@ void ObjectUsage::baseExportToWKT(WKTFormatter *formatter) const {
if (isWKT2 && formatter->outputUsage()) {
auto l_domains = domains();
if (!l_domains.empty()) {
- if (formatter->use2018Keywords()) {
+ if (formatter->use2019Keywords()) {
for (const auto &domain : l_domains) {
formatter->startNode(WKTConstants::USAGE, false);
domain->_exportToWKT(formatter);
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index e9524163..01707a90 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -7943,7 +7943,7 @@ static void exportSourceCRSAndTargetCRSToWKT(const CoordinateOperation *co,
assert(l_targetCRS);
const bool isWKT2 = formatter->version() == io::WKTFormatter::Version::WKT2;
const bool canExportCRSId =
- (isWKT2 && formatter->use2018Keywords() &&
+ (isWKT2 && formatter->use2019Keywords() &&
!(formatter->idOnTopLevelOnly() && formatter->topLevelHasId()));
const bool hasDomains = !co->domains().empty();
@@ -8000,7 +8000,7 @@ void SingleOperation::exportTransformationToWKT(
formatter->addQuotedString(nameStr());
- if (formatter->use2018Keywords()) {
+ if (formatter->use2019Keywords()) {
const auto &version = operationVersion();
if (version.has_value()) {
formatter->startNode(io::WKTConstants::VERSION, false);
@@ -9405,13 +9405,13 @@ ConcatenatedOperationNNPtr ConcatenatedOperation::create(
#ifdef DEBUG_CONCATENATED_OPERATION
{
auto f(io::WKTFormatter::create(
- io::WKTFormatter::Convention::WKT2_2018));
+ io::WKTFormatter::Convention::WKT2_2019));
std::cerr << "Source CRS of step " << i << ":" << std::endl;
std::cerr << l_sourceCRS->exportToWKT(f.get()) << std::endl;
}
{
auto f(io::WKTFormatter::create(
- io::WKTFormatter::Convention::WKT2_2018));
+ io::WKTFormatter::Convention::WKT2_2019));
std::cerr << "Target CRS of step " << i - 1 << ":"
<< std::endl;
std::cerr << lastTargetCRS->exportToWKT(f.get())
@@ -9434,7 +9434,7 @@ ConcatenatedOperationNNPtr ConcatenatedOperation::create(
#ifdef DEBUG_CONCATENATED_OPERATION
{
auto f(
- io::WKTFormatter::create(io::WKTFormatter::Convention::WKT2_2018));
+ io::WKTFormatter::create(io::WKTFormatter::Convention::WKT2_2019));
std::cerr << "ConcatenatedOperation::create()" << std::endl;
std::cerr << op->exportToWKT(f.get()) << std::endl;
}
@@ -9697,16 +9697,16 @@ CoordinateOperationNNPtr ConcatenatedOperation::inverse() const {
//! @cond Doxygen_Suppress
void ConcatenatedOperation::_exportToWKT(io::WKTFormatter *formatter) const {
const bool isWKT2 = formatter->version() == io::WKTFormatter::Version::WKT2;
- if (!isWKT2 || !formatter->use2018Keywords()) {
+ if (!isWKT2 || !formatter->use2019Keywords()) {
throw io::FormattingException(
- "Transformation can only be exported to WKT2:2018");
+ "Transformation can only be exported to WKT2:2019");
}
formatter->startNode(io::WKTConstants::CONCATENATEDOPERATION,
!identifiers().empty());
formatter->addQuotedString(nameStr());
- if (isWKT2 && formatter->use2018Keywords()) {
+ if (isWKT2 && formatter->use2019Keywords()) {
const auto &version = operationVersion();
if (version.has_value()) {
formatter->startNode(io::WKTConstants::VERSION, false);
diff --git a/src/iso19111/coordinatesystem.cpp b/src/iso19111/coordinatesystem.cpp
index 5a852b0d..c58fcaaa 100644
--- a/src/iso19111/coordinatesystem.cpp
+++ b/src/iso19111/coordinatesystem.cpp
@@ -519,7 +519,7 @@ void CoordinateSystem::_exportToWKT(
const auto &l_axisList = axisList();
if (isWKT2) {
formatter->startNode(io::WKTConstants::CS_, !identifiers().empty());
- formatter->add(getWKT2Type(formatter->use2018Keywords()));
+ formatter->add(getWKT2Type(formatter->use2019Keywords()));
formatter->add(static_cast<int>(l_axisList.size()));
formatter->endNode();
formatter->startNode(std::string(),
@@ -1268,8 +1268,8 @@ DateTimeTemporalCS::create(const util::PropertyMap &properties,
// ---------------------------------------------------------------------------
-std::string DateTimeTemporalCS::getWKT2Type(bool use2018Keywords) const {
- return use2018Keywords ? "TemporalDateTime" : "temporal";
+std::string DateTimeTemporalCS::getWKT2Type(bool use2019Keywords) const {
+ return use2019Keywords ? "TemporalDateTime" : "temporal";
}
// ---------------------------------------------------------------------------
@@ -1301,8 +1301,8 @@ TemporalCountCS::create(const util::PropertyMap &properties,
// ---------------------------------------------------------------------------
-std::string TemporalCountCS::getWKT2Type(bool use2018Keywords) const {
- return use2018Keywords ? "TemporalCount" : "temporal";
+std::string TemporalCountCS::getWKT2Type(bool use2019Keywords) const {
+ return use2019Keywords ? "TemporalCount" : "temporal";
}
// ---------------------------------------------------------------------------
@@ -1334,8 +1334,8 @@ TemporalMeasureCS::create(const util::PropertyMap &properties,
// ---------------------------------------------------------------------------
-std::string TemporalMeasureCS::getWKT2Type(bool use2018Keywords) const {
- return use2018Keywords ? "TemporalMeasure" : "temporal";
+std::string TemporalMeasureCS::getWKT2Type(bool use2019Keywords) const {
+ return use2019Keywords ? "TemporalMeasure" : "temporal";
}
} // namespace cs
diff --git a/src/iso19111/crs.cpp b/src/iso19111/crs.cpp
index 60b316f1..07f4eb69 100644
--- a/src/iso19111/crs.cpp
+++ b/src/iso19111/crs.cpp
@@ -1148,7 +1148,7 @@ void GeodeticCRS::_exportToWKT(io::WKTFormatter *formatter) const {
const bool isGeographic =
dynamic_cast<const GeographicCRS *>(this) != nullptr;
formatter->startNode(isWKT2
- ? ((formatter->use2018Keywords() && isGeographic)
+ ? ((formatter->use2019Keywords() && isGeographic)
? io::WKTConstants::GEOGCRS
: io::WKTConstants::GEODCRS)
: isGeocentric() ? io::WKTConstants::GEOCCS
@@ -2698,11 +2698,11 @@ void DerivedCRS::baseExportToWKT(io::WKTFormatter *formatter,
formatter->addQuotedString(nameStr());
const auto &l_baseCRS = d->baseCRS_;
- formatter->startNode(baseKeyword, formatter->use2018Keywords() &&
+ formatter->startNode(baseKeyword, formatter->use2019Keywords() &&
!l_baseCRS->identifiers().empty());
formatter->addQuotedString(l_baseCRS->nameStr());
l_baseCRS->exportDatumOrDatumEnsembleToWkt(formatter);
- if (formatter->use2018Keywords() &&
+ if (formatter->use2019Keywords() &&
!(formatter->idOnTopLevelOnly() && formatter->topLevelHasId())) {
l_baseCRS->formatID(formatter);
}
@@ -2883,9 +2883,9 @@ void ProjectedCRS::_exportToWKT(io::WKTFormatter *formatter) const {
const auto &l_coordinateSystem = d->coordinateSystem();
const auto &axisList = l_coordinateSystem->axisList();
- if (axisList.size() == 3 && !(isWKT2 && formatter->use2018Keywords())) {
+ if (axisList.size() == 3 && !(isWKT2 && formatter->use2019Keywords())) {
io::FormattingException::Throw(
- "Projected 3D CRS can only be exported since WKT2:2018");
+ "Projected 3D CRS can only be exported since WKT2:2019");
}
const auto exportAxis = [&l_coordinateSystem, &axisList, &formatter]() {
@@ -2962,11 +2962,11 @@ void ProjectedCRS::_exportToWKT(io::WKTFormatter *formatter) const {
if (isWKT2) {
formatter->startNode(
- (formatter->use2018Keywords() &&
+ (formatter->use2019Keywords() &&
dynamic_cast<const GeographicCRS *>(l_baseCRS.get()))
? io::WKTConstants::BASEGEOGCRS
: io::WKTConstants::BASEGEODCRS,
- formatter->use2018Keywords() && !l_baseCRS->identifiers().empty());
+ formatter->use2019Keywords() && !l_baseCRS->identifiers().empty());
formatter->addQuotedString(l_baseCRS->nameStr());
l_baseCRS->exportDatumOrDatumEnsembleToWkt(formatter);
// insert ellipsoidal cs unit when the units of the map
@@ -2977,7 +2977,7 @@ void ProjectedCRS::_exportToWKT(io::WKTFormatter *formatter) const {
geodeticCRSAxisList[0]->unit()._exportToWKT(formatter);
}
l_baseCRS->primeMeridian()->_exportToWKT(formatter);
- if (formatter->use2018Keywords() &&
+ if (formatter->use2019Keywords() &&
!(formatter->idOnTopLevelOnly() && formatter->topLevelHasId())) {
l_baseCRS->formatID(formatter);
}
@@ -4422,7 +4422,7 @@ void DerivedGeodeticCRS::_exportToWKT(io::WKTFormatter *formatter) const {
formatter->addQuotedString(nameStr());
auto l_baseCRS = baseCRS();
- formatter->startNode((formatter->use2018Keywords() &&
+ formatter->startNode((formatter->use2019Keywords() &&
dynamic_cast<const GeographicCRS *>(l_baseCRS.get()))
? io::WKTConstants::BASEGEOGCRS
: io::WKTConstants::BASEGEODCRS,
@@ -4560,14 +4560,14 @@ void DerivedGeographicCRS::_exportToWKT(io::WKTFormatter *formatter) const {
io::FormattingException::Throw(
"DerivedGeographicCRS can only be exported to WKT2");
}
- formatter->startNode(formatter->use2018Keywords()
+ formatter->startNode(formatter->use2019Keywords()
? io::WKTConstants::GEOGCRS
: io::WKTConstants::GEODCRS,
!identifiers().empty());
formatter->addQuotedString(nameStr());
auto l_baseCRS = baseCRS();
- formatter->startNode((formatter->use2018Keywords() &&
+ formatter->startNode((formatter->use2019Keywords() &&
dynamic_cast<const GeographicCRS *>(l_baseCRS.get()))
? io::WKTConstants::BASEGEOGCRS
: io::WKTConstants::BASEGEODCRS,
@@ -4693,9 +4693,9 @@ DerivedProjectedCRSNNPtr DerivedProjectedCRS::create(
//! @cond Doxygen_Suppress
void DerivedProjectedCRS::_exportToWKT(io::WKTFormatter *formatter) const {
const bool isWKT2 = formatter->version() == io::WKTFormatter::Version::WKT2;
- if (!isWKT2 || !formatter->use2018Keywords()) {
+ if (!isWKT2 || !formatter->use2019Keywords()) {
io::FormattingException::Throw(
- "DerivedProjectedCRS can only be exported to WKT2:2018");
+ "DerivedProjectedCRS can only be exported to WKT2:2019");
}
formatter->startNode(io::WKTConstants::DERIVEDPROJCRS,
!identifiers().empty());
@@ -5348,12 +5348,12 @@ const char *DerivedCRSTemplate<DerivedCRSTraits>::className() const {
static void DerivedCRSTemplateCheckExportToWKT(io::WKTFormatter *formatter,
const std::string &crsName,
- bool wkt2_2018_only) {
+ bool wkt2_2019_only) {
const bool isWKT2 = formatter->version() == io::WKTFormatter::Version::WKT2;
- if (!isWKT2 || (wkt2_2018_only && !formatter->use2018Keywords())) {
+ if (!isWKT2 || (wkt2_2019_only && !formatter->use2019Keywords())) {
io::FormattingException::Throw(crsName +
" can only be exported to WKT2" +
- (wkt2_2018_only ? ":2018" : ""));
+ (wkt2_2019_only ? ":2019" : ""));
}
}
@@ -5363,7 +5363,7 @@ template <class DerivedCRSTraits>
void DerivedCRSTemplate<DerivedCRSTraits>::_exportToWKT(
io::WKTFormatter *formatter) const {
DerivedCRSTemplateCheckExportToWKT(formatter, DerivedCRSTraits::CRSName(),
- DerivedCRSTraits::wkt2_2018_only);
+ DerivedCRSTraits::wkt2_2019_only);
baseExportToWKT(formatter, DerivedCRSTraits::WKTKeyword(),
DerivedCRSTraits::WKTBaseKeyword());
}
diff --git a/src/iso19111/datum.cpp b/src/iso19111/datum.cpp
index 65905ca9..fffdc022 100644
--- a/src/iso19111/datum.cpp
+++ b/src/iso19111/datum.cpp
@@ -1416,7 +1416,7 @@ void DynamicGeodeticReferenceFrame::_exportToWKT(
io::WKTFormatter *formatter) const // throw(FormattingException)
{
const bool isWKT2 = formatter->version() == io::WKTFormatter::Version::WKT2;
- if (isWKT2 && formatter->use2018Keywords()) {
+ if (isWKT2 && formatter->use2019Keywords()) {
formatter->startNode(io::WKTConstants::DYNAMIC, false);
formatter->startNode(io::WKTConstants::FRAMEEPOCH, false);
formatter->add(
@@ -1530,9 +1530,9 @@ void DatumEnsemble::_exportToWKT(
io::WKTFormatter *formatter) const // throw(FormattingException)
{
const bool isWKT2 = formatter->version() == io::WKTFormatter::Version::WKT2;
- if (!isWKT2 || !formatter->use2018Keywords()) {
+ if (!isWKT2 || !formatter->use2019Keywords()) {
throw io::FormattingException(
- "DatumEnsemble can only be exported to WKT2:2018");
+ "DatumEnsemble can only be exported to WKT2:2019");
}
auto l_datums = datums();
@@ -1941,7 +1941,7 @@ void DynamicVerticalReferenceFrame::_exportToWKT(
io::WKTFormatter *formatter) const // throw(FormattingException)
{
const bool isWKT2 = formatter->version() == io::WKTFormatter::Version::WKT2;
- if (isWKT2 && formatter->use2018Keywords()) {
+ if (isWKT2 && formatter->use2019Keywords()) {
formatter->startNode(io::WKTConstants::DYNAMIC, false);
formatter->startNode(io::WKTConstants::FRAMEEPOCH, false);
formatter->add(
@@ -2067,7 +2067,7 @@ void TemporalDatum::_exportToWKT(
}
formatter->startNode(io::WKTConstants::TDATUM, !identifiers().empty());
formatter->addQuotedString(nameStr());
- if (formatter->use2018Keywords()) {
+ if (formatter->use2019Keywords()) {
formatter->startNode(io::WKTConstants::CALENDAR, false);
formatter->addQuotedString(calendar());
formatter->endNode();
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp
index 4d8fe285..097bc5b8 100644
--- a/src/iso19111/io.cpp
+++ b/src/iso19111/io.cpp
@@ -138,7 +138,7 @@ struct WKTFormatter::Private {
bool forceUNITKeyword_ = false;
bool outputCSUnitOnlyOnceIfSame_ = false;
bool primeMeridianInDegree_ = false;
- bool use2018Keywords_ = false;
+ bool use2019Keywords_ = false;
bool useESRIDialect_ = false;
OutputAxisRule outputAxis_ = WKTFormatter::OutputAxisRule::YES;
};
@@ -299,16 +299,16 @@ WKTFormatter::WKTFormatter(Convention convention)
: d(internal::make_unique<Private>()) {
d->params_.convention_ = convention;
switch (convention) {
- case Convention::WKT2_2018:
- d->params_.use2018Keywords_ = true;
+ case Convention::WKT2_2019:
+ d->params_.use2019Keywords_ = true;
PROJ_FALLTHROUGH
case Convention::WKT2:
d->params_.version_ = WKTFormatter::Version::WKT2;
d->params_.outputAxisOrder_ = true;
break;
- case Convention::WKT2_2018_SIMPLIFIED:
- d->params_.use2018Keywords_ = true;
+ case Convention::WKT2_2019_SIMPLIFIED:
+ d->params_.use2019Keywords_ = true;
PROJ_FALLTHROUGH
case Convention::WKT2_SIMPLIFIED:
d->params_.version_ = WKTFormatter::Version::WKT2;
@@ -689,8 +689,8 @@ WKTFormatter::Version WKTFormatter::version() const {
// ---------------------------------------------------------------------------
-bool WKTFormatter::use2018Keywords() const {
- return d->params_.use2018Keywords_;
+bool WKTFormatter::use2019Keywords() const {
+ return d->params_.use2019Keywords_;
}
// ---------------------------------------------------------------------------
@@ -2569,7 +2569,7 @@ WKTParser::Private::buildCS(const WKTNodeNNPtr &node, /* maybe null */
return SphericalCS::create(csMap, axisList[0], axisList[1],
axisList[2]);
}
- } else if (ci_equal(csType, "ordinal")) { // WKT2-2018
+ } else if (ci_equal(csType, "ordinal")) { // WKT2-2019
return OrdinalCS::create(csMap, axisList);
} else if (ci_equal(csType, "parametric")) {
if (axisCount == 1) {
@@ -2582,15 +2582,15 @@ WKTParser::Private::buildCS(const WKTNodeNNPtr &node, /* maybe null */
axisList[0]); // FIXME: there are 3 possible subtypes of
// TemporalCS
}
- } else if (ci_equal(csType, "TemporalDateTime")) { // WKT2-2018
+ } else if (ci_equal(csType, "TemporalDateTime")) { // WKT2-2019
if (axisCount == 1) {
return DateTimeTemporalCS::create(csMap, axisList[0]);
}
- } else if (ci_equal(csType, "TemporalCount")) { // WKT2-2018
+ } else if (ci_equal(csType, "TemporalCount")) { // WKT2-2019
if (axisCount == 1) {
return TemporalCountCS::create(csMap, axisList[0]);
}
- } else if (ci_equal(csType, "TemporalMeasure")) { // WKT2-2018
+ } else if (ci_equal(csType, "TemporalMeasure")) { // WKT2-2019
if (axisCount == 1) {
return TemporalMeasureCS::create(csMap, axisList[0]);
}
@@ -2729,7 +2729,7 @@ WKTParser::Private::buildGeodeticCRS(const WKTNodeNNPtr &node) {
} else if (ci_equal(nodeName, WKTConstants::GEOGCRS) ||
ci_equal(nodeName, WKTConstants::GEOGRAPHICCRS) ||
ci_equal(nodeName, WKTConstants::BASEGEOGCRS)) {
- // This is a WKT2-2018 GeographicCRS. An ellipsoidal CS is expected
+ // This is a WKT2-2019 GeographicCRS. An ellipsoidal CS is expected
throw ParsingException(concat("ellipsoidal CS expected, but found ",
cs->getWKT2Type(true)));
}
@@ -2795,7 +2795,7 @@ CRSNNPtr WKTParser::Private::buildDerivedGeodeticCRS(const WKTNodeNNPtr &node) {
derivingConversion,
NN_NO_CHECK(ellipsoidalCS));
} else if (ci_equal(nodeP->value(), WKTConstants::GEOGCRS)) {
- // This is a WKT2-2018 GeographicCRS. An ellipsoidal CS is expected
+ // This is a WKT2-2019 GeographicCRS. An ellipsoidal CS is expected
throw ParsingException(concat("ellipsoidal CS expected, but found ",
cs->getWKT2Type(true)));
}
@@ -4173,8 +4173,8 @@ WKTParser::Private::buildDerivedProjectedCRS(const WKTNodeNNPtr &node) {
static bool isGeodeticCRS(const std::string &name) {
return ci_equal(name, WKTConstants::GEODCRS) || // WKT2
ci_equal(name, WKTConstants::GEODETICCRS) || // WKT2
- ci_equal(name, WKTConstants::GEOGCRS) || // WKT2 2018
- ci_equal(name, WKTConstants::GEOGRAPHICCRS) || // WKT2 2018
+ ci_equal(name, WKTConstants::GEOGCRS) || // WKT2 2019
+ ci_equal(name, WKTConstants::GEOGRAPHICCRS) || // WKT2 2019
ci_equal(name, WKTConstants::GEOGCS) || // WKT1
ci_equal(name, WKTConstants::GEOCCS); // WKT1
}
@@ -5921,7 +5921,7 @@ BaseObjectNNPtr WKTParser::createFromWKT(const std::string &wkt) {
d->emitRecoverableWarning(errorMsg);
}
} else if (dialect == WKTGuessedDialect::WKT2_2015 ||
- dialect == WKTGuessedDialect::WKT2_2018) {
+ dialect == WKTGuessedDialect::WKT2_2019) {
auto errorMsg = pj_wkt2_parse(wkt);
if (!errorMsg.empty()) {
d->emitRecoverableWarning(errorMsg);
@@ -5961,7 +5961,7 @@ WKTParser::guessDialect(const std::string &wkt) noexcept {
}
}
- const std::string *const wkt2_2018_only_keywords[] = {
+ const std::string *const wkt2_2019_only_keywords[] = {
&WKTConstants::GEOGCRS,
// contained in previous one
// &WKTConstants::BASEGEOGCRS,
@@ -5971,19 +5971,19 @@ WKTParser::guessDialect(const std::string &wkt) noexcept {
&WKTConstants::DERIVEDPROJCRS, &WKTConstants::BASEPROJCRS,
&WKTConstants::GEOGRAPHICCRS, &WKTConstants::TRF, &WKTConstants::VRF};
- for (const auto &pointerKeyword : wkt2_2018_only_keywords) {
+ for (const auto &pointerKeyword : wkt2_2019_only_keywords) {
auto pos = ci_find(wkt, *pointerKeyword);
if (pos != std::string::npos &&
wkt[pos + pointerKeyword->size()] == '[') {
- return WKTGuessedDialect::WKT2_2018;
+ return WKTGuessedDialect::WKT2_2019;
}
}
- static const char *const wkt2_2018_only_substrings[] = {
+ static const char *const wkt2_2019_only_substrings[] = {
"CS[TemporalDateTime,", "CS[TemporalCount,", "CS[TemporalMeasure,",
};
- for (const auto &substrings : wkt2_2018_only_substrings) {
+ for (const auto &substrings : wkt2_2019_only_substrings) {
if (ci_find(wkt, substrings) != std::string::npos) {
- return WKTGuessedDialect::WKT2_2018;
+ return WKTGuessedDialect::WKT2_2019;
}
}
diff --git a/src/proj.h b/src/proj.h
index 22b4c021..6e6d63b4 100644
--- a/src/proj.h
+++ b/src/proj.h
@@ -478,8 +478,11 @@ typedef char **PROJ_STRING_LIST;
/** \brief Guessed WKT "dialect". */
typedef enum
{
- /** \ref WKT2_2018 */
- PJ_GUESSED_WKT2_2018,
+ /** \ref WKT2_2019 */
+ PJ_GUESSED_WKT2_2019,
+
+ /** Deprecated alias for PJ_GUESSED_WKT2_2019 */
+ PJ_GUESSED_WKT2_2018 = PJ_GUESSED_WKT2_2019,
/** \ref WKT2_2015 */
PJ_GUESSED_WKT2_2015,
@@ -575,10 +578,14 @@ typedef enum
PJ_WKT2_2015,
/** cf osgeo::proj::io::WKTFormatter::Convention::WKT2_SIMPLIFIED */
PJ_WKT2_2015_SIMPLIFIED,
- /** cf osgeo::proj::io::WKTFormatter::Convention::WKT2_2018 */
- PJ_WKT2_2018,
- /** cf osgeo::proj::io::WKTFormatter::Convention::WKT2_2018_SIMPLIFIED */
- PJ_WKT2_2018_SIMPLIFIED,
+ /** cf osgeo::proj::io::WKTFormatter::Convention::WKT2_2019 */
+ PJ_WKT2_2019,
+ /** Deprecated alias for PJ_WKT2_2019 */
+ PJ_WKT2_2018 = PJ_WKT2_2019,
+ /** cf osgeo::proj::io::WKTFormatter::Convention::WKT2_2019_SIMPLIFIED */
+ PJ_WKT2_2019_SIMPLIFIED,
+ /** Deprecated alias for PJ_WKT2_2019 */
+ PJ_WKT2_2018_SIMPLIFIED = PJ_WKT2_2019_SIMPLIFIED,
/** cf osgeo::proj::io::WKTFormatter::Convention::WKT1_GDAL */
PJ_WKT1_GDAL,
/** cf osgeo::proj::io::WKTFormatter::Convention::WKT1_ESRI */