From 6cac8e03056db41a8314756c16507ef39bd78e0a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 13 Dec 2018 15:32:24 +0100 Subject: Add helpers to create polar cartesian CS --- src/coordinatesystem.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/coordinatesystem.cpp') diff --git a/src/coordinatesystem.cpp b/src/coordinatesystem.cpp index 2305e6c4..b274f583 100644 --- a/src/coordinatesystem.cpp +++ b/src/coordinatesystem.cpp @@ -947,6 +947,54 @@ CartesianCS::createNorthingEasting(const common::UnitOfMeasure &unit) { // --------------------------------------------------------------------------- +/** \brief Instanciate a CartesianCS, north-pole centered, + * with a Easting (first) South-Oriented and + * Northing (second) South-Oriented axis. + * + * @param unit Linear unit of the axes. + * @return a new CartesianCS. + */ +CartesianCSNNPtr CartesianCS::createNorthPoleEastingSouthNorthingSouth( + const common::UnitOfMeasure &unit) { + return create(util::PropertyMap(), + CoordinateSystemAxis::create( + util::PropertyMap().set(IdentifiedObject::NAME_KEY, + AxisName::Easting), + AxisAbbreviation::E, AxisDirection::SOUTH, unit, + Meridian::create(common::Angle(90))), + CoordinateSystemAxis::create( + util::PropertyMap().set(IdentifiedObject::NAME_KEY, + AxisName::Northing), + AxisAbbreviation::N, AxisDirection::SOUTH, unit, + Meridian::create(common::Angle(180)))); +} + +// --------------------------------------------------------------------------- + +/** \brief Instanciate a CartesianCS, south-pole centered, + * with a Easting (first) North-Oriented and + * Northing (second) North-Oriented axis. + * + * @param unit Linear unit of the axes. + * @return a new CartesianCS. + */ +CartesianCSNNPtr CartesianCS::createSouthPoleEastingNorthNorthingNorth( + const common::UnitOfMeasure &unit) { + return create(util::PropertyMap(), + CoordinateSystemAxis::create( + util::PropertyMap().set(IdentifiedObject::NAME_KEY, + AxisName::Easting), + AxisAbbreviation::E, AxisDirection::NORTH, unit, + Meridian::create(common::Angle(90))), + CoordinateSystemAxis::create( + util::PropertyMap().set(IdentifiedObject::NAME_KEY, + AxisName::Northing), + AxisAbbreviation::N, AxisDirection::NORTH, unit, + Meridian::create(common::Angle(0)))); +} + +// --------------------------------------------------------------------------- + /** \brief Instanciate a CartesianCS with the three geocentric axes. * * @param unit Liinear unit of the axes. -- cgit v1.2.3