aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-07-09 15:45:28 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-07-09 15:45:28 +0200
commit062c7f160f4b1d41f82730fa6eb6653e78ade74a (patch)
tree333112fdc326bd2318e87e77b697e66020e6192f /src
parent668fb0aacd46db2c4aaadb557b14443eee028405 (diff)
downloadPROJ-062c7f160f4b1d41f82730fa6eb6653e78ade74a.tar.gz
PROJ-062c7f160f4b1d41f82730fa6eb6653e78ade74a.zip
Transverse Mercator South Orientated: restrict export to PROJ string to cases where false_easting and false_northing are 0
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/coordinateoperation.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index dd8658fb..3d5287a3 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -6165,6 +6165,25 @@ void Conversion::_exportToPROJString(
std::string("Unsupported value for ") +
EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN);
}
+ } else if (methodEPSGCode ==
+ EPSG_CODE_METHOD_TRANSVERSE_MERCATOR_SOUTH_ORIENTATED) {
+ // We map TMSO to tmerc with axis=wsu. This only works if false easting
+ // and northings are zero, which is the case in practice for South
+ // African and Namibian EPSG CRS
+ const auto falseEasting = parameterValueNumeric(
+ EPSG_CODE_PARAMETER_FALSE_EASTING, common::UnitOfMeasure::METRE);
+ if (falseEasting != 0) {
+ throw io::FormattingException(
+ std::string("Unsupported value for ") +
+ EPSG_NAME_PARAMETER_FALSE_EASTING);
+ }
+ const auto falseNorthing = parameterValueNumeric(
+ EPSG_CODE_PARAMETER_FALSE_NORTHING, common::UnitOfMeasure::METRE);
+ if (falseNorthing != 0) {
+ throw io::FormattingException(
+ std::string("Unsupported value for ") +
+ EPSG_NAME_PARAMETER_FALSE_NORTHING);
+ }
// PROJ.4 specific hack for webmercator
} else if (formatter->getCRSExport() &&
methodEPSGCode ==