From 1ce2cc80a4a0ff248cda778ae16de51946fa61b7 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 24 Feb 2020 15:40:25 +0100 Subject: CompoundCRS::create(): reject combinations of components not allowed by ISO 19111 --- include/proj/crs.hpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/proj/crs.hpp b/include/proj/crs.hpp index 3b760099..30134cb4 100644 --- a/include/proj/crs.hpp +++ b/include/proj/crs.hpp @@ -834,6 +834,22 @@ class PROJ_GCC_DLL ParametricCRS : virtual public SingleCRS { // --------------------------------------------------------------------------- +/** \brief Exception thrown when attempting to create an invalid compound CRS + */ +class PROJ_GCC_DLL InvalidCompoundCRSException : public util::Exception { + public: + //! @cond Doxygen_Suppress + PROJ_INTERNAL explicit InvalidCompoundCRSException(const char *message); + PROJ_INTERNAL explicit InvalidCompoundCRSException( + const std::string &message); + PROJ_DLL + InvalidCompoundCRSException(const InvalidCompoundCRSException &other); + PROJ_DLL ~InvalidCompoundCRSException() override; + //! @endcond +}; + +// --------------------------------------------------------------------------- + class CompoundCRS; /** Shared pointer of CompoundCRS */ using CompoundCRSPtr = std::shared_ptr; @@ -873,7 +889,8 @@ class PROJ_GCC_DLL CompoundCRS final : public CRS, PROJ_DLL static CompoundCRSNNPtr create(const util::PropertyMap &properties, - const std::vector &components); + const std::vector + &components); // throw InvalidCompoundCRSException protected: // relaxed: standard say SingleCRSNNPtr -- cgit v1.2.3