aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-02-24 15:40:25 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-02-25 00:19:19 +0100
commit1ce2cc80a4a0ff248cda778ae16de51946fa61b7 (patch)
tree8d0bda34e07d8637f6bc6c29c86400b6ce81c08c /include
parent254bead44a3fe11a24418bf71813298aa2b386f1 (diff)
downloadPROJ-1ce2cc80a4a0ff248cda778ae16de51946fa61b7.tar.gz
PROJ-1ce2cc80a4a0ff248cda778ae16de51946fa61b7.zip
CompoundCRS::create(): reject combinations of components not allowed by ISO 19111
Diffstat (limited to 'include')
-rw-r--r--include/proj/crs.hpp19
1 files changed, 18 insertions, 1 deletions
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<CompoundCRS>;
@@ -873,7 +889,8 @@ class PROJ_GCC_DLL CompoundCRS final : public CRS,
PROJ_DLL static CompoundCRSNNPtr
create(const util::PropertyMap &properties,
- const std::vector<CRSNNPtr> &components);
+ const std::vector<CRSNNPtr>
+ &components); // throw InvalidCompoundCRSException
protected:
// relaxed: standard say SingleCRSNNPtr