aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-13 17:17:36 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-13 17:17:36 +0100
commited14754a6b3ec488ab2994a43d3533763627ba70 (patch)
tree08fdfbde41b225f1976560256261a5ba2b24ca9f /src
parent7ce68ff69084faece5ee3ef1be4b5bbbf3e30de3 (diff)
downloadPROJ-ed14754a6b3ec488ab2994a43d3533763627ba70.tar.gz
PROJ-ed14754a6b3ec488ab2994a43d3533763627ba70.zip
imort from WKT1: set correct CS for Transverse Mercator South Oriented
Diffstat (limited to 'src')
-rw-r--r--src/c_api.cpp4
-rw-r--r--src/coordinatesystem.cpp21
-rw-r--r--src/io.cpp4
-rw-r--r--src/proj_experimental.h2
4 files changed, 31 insertions, 0 deletions
diff --git a/src/c_api.cpp b/src/c_api.cpp
index a11d5a9b..0f189eaa 100644
--- a/src/c_api.cpp
+++ b/src/c_api.cpp
@@ -2989,6 +2989,10 @@ PJ_OBJ *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
return PJ_OBJ::create(
CartesianCS::createSouthPoleEastingNorthNorthingNorth(
createLinearUnit(unit_name, unit_conv_factor)));
+
+ case PJ_CART2D_WESTING_SOUTHING:
+ return PJ_OBJ::create(CartesianCS::createWestingSouthing(
+ createLinearUnit(unit_name, unit_conv_factor)));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
diff --git a/src/coordinatesystem.cpp b/src/coordinatesystem.cpp
index b274f583..a3ad04e0 100644
--- a/src/coordinatesystem.cpp
+++ b/src/coordinatesystem.cpp
@@ -947,6 +947,27 @@ CartesianCS::createNorthingEasting(const common::UnitOfMeasure &unit) {
// ---------------------------------------------------------------------------
+/** \brief Instanciate a CartesianCS with a Westing (first) and Southing
+ * (second) axis.
+ *
+ * @param unit Linear unit of the axes.
+ * @return a new CartesianCS.
+ */
+CartesianCSNNPtr
+CartesianCS::createWestingSouthing(const common::UnitOfMeasure &unit) {
+ return create(util::PropertyMap(),
+ CoordinateSystemAxis::create(
+ util::PropertyMap().set(IdentifiedObject::NAME_KEY,
+ AxisName::Easting),
+ AxisAbbreviation::Y, AxisDirection::WEST, unit),
+ CoordinateSystemAxis::create(
+ util::PropertyMap().set(IdentifiedObject::NAME_KEY,
+ AxisName::Northing),
+ AxisAbbreviation::X, AxisDirection::SOUTH, unit));
+}
+
+// ---------------------------------------------------------------------------
+
/** \brief Instanciate a CartesianCS, north-pole centered,
* with a Easting (first) South-Oriented and
* Northing (second) South-Oriented axis.
diff --git a/src/io.cpp b/src/io.cpp
index caf9b53d..fb00bcd1 100644
--- a/src/io.cpp
+++ b/src/io.cpp
@@ -3514,6 +3514,10 @@ WKTParser::Private::buildProjectedCRS(const WKTNodeNNPtr &node) {
linearUnit)
.as_nullable();
}
+ } else if (methodCode ==
+ EPSG_CODE_METHOD_TRANSVERSE_MERCATOR_SOUTH_ORIENTATED) {
+ cartesianCS =
+ CartesianCS::createWestingSouthing(linearUnit).as_nullable();
}
}
if (!cartesianCS) {
diff --git a/src/proj_experimental.h b/src/proj_experimental.h
index aeee4e5b..c575b9ae 100644
--- a/src/proj_experimental.h
+++ b/src/proj_experimental.h
@@ -105,6 +105,8 @@ typedef enum
PJ_CART2D_NORTH_POLE_EASTING_SOUTH_NORTHING_SOUTH,
/* South Pole Easting/NORTH-Norting/NORTH */
PJ_CART2D_SOUTH_POLE_EASTING_NORTH_NORTHING_NORTH,
+ /* Westing-southing */
+ PJ_CART2D_WESTING_SOUTHING,
} PJ_CARTESIAN_CS_2D_TYPE;
PJ_OBJ PROJ_DLL *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,