Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WKT import to support WKT2 corrigendum #3573

Merged
merged 2 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions data/projjson.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
"unspecified" ] },
"meridian": { "$ref": "#/definitions/meridian" },
"unit": { "$ref": "#/definitions/unit" },
"minimum_value": { "type": "number" },
"maximum_value": { "type": "number" },
"range_meaning": { "type": "string", "enum": [ "exact", "wraparound"] },
"id": { "$ref": "#/definitions/id" },
"ids": { "$ref": "#/definitions/ids" }
},
Expand Down Expand Up @@ -479,6 +482,7 @@
"type": { "type": "string", "enum": ["DynamicGeodeticReferenceFrame"] },
"name": {},
"anchor": {},
"anchor_epoch": {},
"ellipsoid": {},
"prime_meridian": {},
"frame_reference_epoch": { "type": "number" },
Expand All @@ -503,6 +507,7 @@
"type": { "type": "string", "enum": ["DynamicVerticalReferenceFrame"] },
"name": {},
"anchor": {},
"anchor_epoch": {},
"frame_reference_epoch": { "type": "number" },
"$schema" : {},
"scope": {},
Expand Down Expand Up @@ -651,6 +656,7 @@
"type": { "type": "string", "enum": ["GeodeticReferenceFrame"] },
"name": { "type": "string" },
"anchor": { "type": "string" },
"anchor_epoch": { "type": "number" },
"ellipsoid": { "$ref": "#/definitions/ellipsoid" },
"prime_meridian": { "$ref": "#/definitions/prime_meridian" },
"$schema" : {},
Expand Down Expand Up @@ -1147,6 +1153,7 @@
"type": { "type": "string", "enum": ["VerticalReferenceFrame"] },
"name": { "type": "string" },
"anchor": { "type": "string" },
"anchor_epoch": { "type": "number" },
"$schema" : {},
"scope": {},
"area": {},
Expand Down
7 changes: 6 additions & 1 deletion docs/source/specifications/projjson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ in the WKT2:2019 specification also apply, as supplement to the JSON schema cons
History of the schema
---------------------

* v0.6: additional optional "source_crs" property in "abridged_transformation". Added CoordinateMeta. Implemented in PROJ 9.2
* v0.6:
- Implemented in PROJ 9.2
- Additional optional "source_crs" property in "abridged_transformation".
- Added CoordinateMetadata
- Added "datum_epoch" property to GeodeticReferenceFrame and VerticalReferenceFrame
- Added "minimum_value", "maximum_value" and "range_meaning" properties to Axis
* v0.5:
- Implemented in PROJ 9.1:
+ add "meridian" member in Axis object type.
Expand Down
38 changes: 38 additions & 0 deletions include/proj/coordinatesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,34 @@ class AxisDirection : public util::CodeList {

// ---------------------------------------------------------------------------

/** \brief Meaning of the axis value range specified through minimumValue and
* maximumValue
*
* \remark Implements RangeMeaning from \ref ISO_19111_2019
* \since 9.2
*/
class RangeMeaning : public util::CodeList {
public:
//! @cond Doxygen_Suppress
PROJ_DLL static const RangeMeaning *
valueOf(const std::string &nameIn) noexcept;
//! @endcond

PROJ_DLL static const RangeMeaning EXACT;
PROJ_DLL static const RangeMeaning WRAPAROUND;

protected:
friend class util::optional<RangeMeaning>;
RangeMeaning();

private:
explicit RangeMeaning(const std::string &nameIn);

static std::map<std::string, const RangeMeaning *> registry;
};

// ---------------------------------------------------------------------------

class Meridian;
/** Shared pointer of Meridian. */
using MeridianPtr = std::shared_ptr<Meridian>;
Expand Down Expand Up @@ -181,6 +209,7 @@ class PROJ_GCC_DLL CoordinateSystemAxis final : public common::IdentifiedObject,
PROJ_DLL const common::UnitOfMeasure &unit() PROJ_PURE_DECL;
PROJ_DLL const util::optional<double> &minimumValue() PROJ_PURE_DECL;
PROJ_DLL const util::optional<double> &maximumValue() PROJ_PURE_DECL;
PROJ_DLL const util::optional<RangeMeaning> &rangeMeaning() PROJ_PURE_DECL;
PROJ_DLL const MeridianPtr &meridian() PROJ_PURE_DECL;

// Non-standard
Expand All @@ -190,6 +219,15 @@ class PROJ_GCC_DLL CoordinateSystemAxis final : public common::IdentifiedObject,
const common::UnitOfMeasure &unitIn,
const MeridianPtr &meridianIn = nullptr);

PROJ_DLL static CoordinateSystemAxisNNPtr
create(const util::PropertyMap &properties,
const std::string &abbreviationIn, const AxisDirection &directionIn,
const common::UnitOfMeasure &unitIn,
const util::optional<double> &minimumValueIn,
const util::optional<double> &maximumValueIn,
const util::optional<RangeMeaning> &rangeMeaningIn,
const MeridianPtr &meridianIn = nullptr);

PROJ_PRIVATE :

//! @cond Doxygen_Suppress
Expand Down
16 changes: 16 additions & 0 deletions include/proj/datum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class PROJ_GCC_DLL Datum : public common::ObjectUsage,
//! @endcond

PROJ_DLL const util::optional<std::string> &anchorDefinition() const;
PROJ_DLL const util::optional<common::Measure> &anchorEpoch() const;
PROJ_DLL const util::optional<common::DateTime> &publicationDate() const;
PROJ_DLL const common::IdentifiedObjectPtr &conventionalRS() const;

Expand All @@ -91,6 +92,8 @@ class PROJ_GCC_DLL Datum : public common::ObjectUsage,

protected:
PROJ_INTERNAL void setAnchor(const util::optional<std::string> &anchor);
PROJ_INTERNAL void
setAnchorEpoch(const util::optional<common::Measure> &anchorEpoch);

PROJ_INTERNAL void
setProperties(const util::PropertyMap
Expand Down Expand Up @@ -414,6 +417,12 @@ class PROJ_GCC_DLL GeodeticReferenceFrame : public Datum {
const util::optional<std::string> &anchor,
const PrimeMeridianNNPtr &primeMeridian);

PROJ_DLL static GeodeticReferenceFrameNNPtr
create(const util::PropertyMap &properties, const EllipsoidNNPtr &ellipsoid,
const util::optional<std::string> &anchor,
const util::optional<common::Measure> &anchorEpoch,
const PrimeMeridianNNPtr &primeMeridian);

PROJ_DLL static const GeodeticReferenceFrameNNPtr
EPSG_6267; // North American Datum 1927
PROJ_DLL static const GeodeticReferenceFrameNNPtr
Expand Down Expand Up @@ -584,6 +593,13 @@ class PROJ_GCC_DLL VerticalReferenceFrame : public Datum {
const util::optional<RealizationMethod> &realizationMethodIn =
util::optional<RealizationMethod>());

PROJ_DLL static VerticalReferenceFrameNNPtr
create(const util::PropertyMap &properties,
const util::optional<std::string> &anchor,
const util::optional<common::Measure> &anchorEpoch,
const util::optional<RealizationMethod> &realizationMethodIn =
util::optional<RealizationMethod>());

//! @cond Doxygen_Suppress
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
Expand Down
4 changes: 4 additions & 0 deletions include/proj/internal/io_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class WKTConstants {
static const std::string MERIDIAN;
static const std::string ORDER;
static const std::string ANCHOR;
static const std::string ANCHOREPOCH; // WKT2-2019
static const std::string CONVERSION;
static const std::string METHOD;
static const std::string REMARK;
Expand Down Expand Up @@ -139,6 +140,9 @@ class WKTConstants {
static const std::string GEOIDMODEL; // WKT2-2019
static const std::string COORDINATEMETADATA; // WKT2-2019
static const std::string EPOCH; // WKT2-2019
static const std::string AXISMINVALUE; // WKT2-2019
static const std::string AXISMAXVALUE; // WKT2-2019
static const std::string RANGEMEANING; // WKT2-2019

// WKT2 alternate (longer or shorter)
static const std::string GEODETICCRS;
Expand Down
7 changes: 7 additions & 0 deletions schemas/v0.6/projjson.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
"unspecified" ] },
"meridian": { "$ref": "#/definitions/meridian" },
"unit": { "$ref": "#/definitions/unit" },
"minimum_value": { "type": "number" },
"maximum_value": { "type": "number" },
"range_meaning": { "type": "string", "enum": [ "exact", "wraparound"] },
"id": { "$ref": "#/definitions/id" },
"ids": { "$ref": "#/definitions/ids" }
},
Expand Down Expand Up @@ -479,6 +482,7 @@
"type": { "type": "string", "enum": ["DynamicGeodeticReferenceFrame"] },
"name": {},
"anchor": {},
"anchor_epoch": {},
"ellipsoid": {},
"prime_meridian": {},
"frame_reference_epoch": { "type": "number" },
Expand All @@ -503,6 +507,7 @@
"type": { "type": "string", "enum": ["DynamicVerticalReferenceFrame"] },
"name": {},
"anchor": {},
"anchor_epoch": {},
"frame_reference_epoch": { "type": "number" },
"$schema" : {},
"scope": {},
Expand Down Expand Up @@ -651,6 +656,7 @@
"type": { "type": "string", "enum": ["GeodeticReferenceFrame"] },
"name": { "type": "string" },
"anchor": { "type": "string" },
"anchor_epoch": { "type": "number" },
"ellipsoid": { "$ref": "#/definitions/ellipsoid" },
"prime_meridian": { "$ref": "#/definitions/prime_meridian" },
"$schema" : {},
Expand Down Expand Up @@ -1147,6 +1153,7 @@
"type": { "type": "string", "enum": ["VerticalReferenceFrame"] },
"name": { "type": "string" },
"anchor": { "type": "string" },
"anchor_epoch": { "type": "number" },
"$schema" : {},
"scope": {},
"area": {},
Expand Down
6 changes: 6 additions & 0 deletions scripts/reference_exported_symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,14 @@ osgeo::proj::cs::CartesianCS::createSouthPoleEastingNorthNorthingNorth(osgeo::pr
osgeo::proj::cs::CartesianCS::createWestingSouthing(osgeo::proj::common::UnitOfMeasure const&)
osgeo::proj::cs::CoordinateSystemAxis::abbreviation() const
osgeo::proj::cs::CoordinateSystemAxis::~CoordinateSystemAxis()
osgeo::proj::cs::CoordinateSystemAxis::create(osgeo::proj::util::PropertyMap const&, std::string const&, osgeo::proj::cs::AxisDirection const&, osgeo::proj::common::UnitOfMeasure const&, osgeo::proj::util::optional<double> const&, osgeo::proj::util::optional<double> const&, osgeo::proj::util::optional<osgeo::proj::cs::RangeMeaning> const&, std::shared_ptr<osgeo::proj::cs::Meridian> const&)
osgeo::proj::cs::CoordinateSystemAxis::create(osgeo::proj::util::PropertyMap const&, std::string const&, osgeo::proj::cs::AxisDirection const&, osgeo::proj::common::UnitOfMeasure const&, std::shared_ptr<osgeo::proj::cs::Meridian> const&)
osgeo::proj::cs::CoordinateSystemAxis::direction() const
osgeo::proj::cs::CoordinateSystem::axisList() const
osgeo::proj::cs::CoordinateSystemAxis::maximumValue() const
osgeo::proj::cs::CoordinateSystemAxis::meridian() const
osgeo::proj::cs::CoordinateSystemAxis::minimumValue() const
osgeo::proj::cs::CoordinateSystemAxis::rangeMeaning() const
osgeo::proj::cs::CoordinateSystemAxis::unit() const
osgeo::proj::cs::CoordinateSystem::~CoordinateSystem()
osgeo::proj::cs::DateTimeTemporalCS::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystemAxis> > const&)
Expand All @@ -234,6 +236,7 @@ osgeo::proj::cs::OrdinalCS::create(osgeo::proj::util::PropertyMap const&, std::v
osgeo::proj::cs::OrdinalCS::~OrdinalCS()
osgeo::proj::cs::ParametricCS::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystemAxis> > const&)
osgeo::proj::cs::ParametricCS::~ParametricCS()
osgeo::proj::cs::RangeMeaning::valueOf(std::string const&)
osgeo::proj::cs::SphericalCS::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystemAxis> > const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystemAxis> > const&)
osgeo::proj::cs::SphericalCS::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystemAxis> > const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystemAxis> > const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystemAxis> > const&)
osgeo::proj::cs::SphericalCS::~SphericalCS()
Expand All @@ -246,6 +249,7 @@ osgeo::proj::cs::VerticalCS::createGravityRelatedHeight(osgeo::proj::common::Uni
osgeo::proj::cs::VerticalCS::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystemAxis> > const&)
osgeo::proj::cs::VerticalCS::~VerticalCS()
osgeo::proj::datum::Datum::anchorDefinition() const
osgeo::proj::datum::Datum::anchorEpoch() const
osgeo::proj::datum::Datum::conventionalRS() const
osgeo::proj::datum::Datum::~Datum()
osgeo::proj::datum::DatumEnsemble::asDatum(std::shared_ptr<osgeo::proj::io::DatabaseContext> const&) const
Expand Down Expand Up @@ -279,6 +283,7 @@ osgeo::proj::datum::Ellipsoid::squaredEccentricity() const
osgeo::proj::datum::EngineeringDatum::create(osgeo::proj::util::PropertyMap const&, osgeo::proj::util::optional<std::string> const&)
osgeo::proj::datum::EngineeringDatum::~EngineeringDatum()
osgeo::proj::datum::GeodeticReferenceFrame::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::datum::Ellipsoid> > const&, osgeo::proj::util::optional<std::string> const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::datum::PrimeMeridian> > const&)
osgeo::proj::datum::GeodeticReferenceFrame::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::datum::Ellipsoid> > const&, osgeo::proj::util::optional<std::string> const&, osgeo::proj::util::optional<osgeo::proj::common::Measure> const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::datum::PrimeMeridian> > const&)
osgeo::proj::datum::GeodeticReferenceFrame::ellipsoid() const
osgeo::proj::datum::GeodeticReferenceFrame::~GeodeticReferenceFrame()
osgeo::proj::datum::GeodeticReferenceFrame::hasEquivalentNameToUsingAlias(osgeo::proj::common::IdentifiedObject const*, std::shared_ptr<osgeo::proj::io::DatabaseContext> const&) const
Expand All @@ -294,6 +299,7 @@ osgeo::proj::datum::TemporalDatum::calendar() const
osgeo::proj::datum::TemporalDatum::create(osgeo::proj::util::PropertyMap const&, osgeo::proj::common::DateTime const&, std::string const&)
osgeo::proj::datum::TemporalDatum::~TemporalDatum()
osgeo::proj::datum::TemporalDatum::temporalOrigin() const
osgeo::proj::datum::VerticalReferenceFrame::create(osgeo::proj::util::PropertyMap const&, osgeo::proj::util::optional<std::string> const&, osgeo::proj::util::optional<osgeo::proj::common::Measure> const&, osgeo::proj::util::optional<osgeo::proj::datum::RealizationMethod> const&)
osgeo::proj::datum::VerticalReferenceFrame::create(osgeo::proj::util::PropertyMap const&, osgeo::proj::util::optional<std::string> const&, osgeo::proj::util::optional<osgeo::proj::datum::RealizationMethod> const&)
osgeo::proj::datum::VerticalReferenceFrame::realizationMethod() const
osgeo::proj::datum::VerticalReferenceFrame::~VerticalReferenceFrame()
Expand Down
Loading