aboutsummaryrefslogtreecommitdiff
path: root/src/proj_internal.h
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-01-21 19:31:02 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-01-22 00:10:23 +0100
commited462b39fb7d9b92a75a069da707f2b7921b2820 (patch)
tree61a99c6887ce7d853c7eaf1216d53ee191812a9a /src/proj_internal.h
parenta4ec5e49bbcf3de1c779c3ed13389def99dd6a4e (diff)
downloadPROJ-ed462b39fb7d9b92a75a069da707f2b7921b2820.tar.gz
PROJ-ed462b39fb7d9b92a75a069da707f2b7921b2820.zip
proj_create_crs_to_crs(): defer selection of actual coordinate operation until proj_trans() is called (fixes #1229)
Diffstat (limited to 'src/proj_internal.h')
-rw-r--r--src/proj_internal.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/proj_internal.h b/src/proj_internal.h
index b97afdec..f5196939 100644
--- a/src/proj_internal.h
+++ b/src/proj_internal.h
@@ -60,6 +60,7 @@
#include "proj/common.hpp"
#include "proj/coordinateoperation.hpp"
+
#include <string>
#include <vector>
@@ -519,6 +520,50 @@ struct PJconsts {
mutable std::vector<NS_PROJ::operation::GridDescription> gridsNeeded{};
/*************************************************************************************
+ proj_create_crs_to_crs() alternative coordinate operations
+ **************************************************************************************/
+
+ struct CoordOperation
+ {
+ double minxSrc = 0.0;
+ double minySrc = 0.0;
+ double maxxSrc = 0.0;
+ double maxySrc = 0.0;
+ double minxDst = 0.0;
+ double minyDst = 0.0;
+ double maxxDst = 0.0;
+ double maxyDst = 0.0;
+ PJ* pj = nullptr;
+ std::string name{};
+
+ CoordOperation(double minxSrcIn, double minySrcIn, double maxxSrcIn, double maxySrcIn,
+ double minxDstIn, double minyDstIn, double maxxDstIn, double maxyDstIn,
+ PJ* pjIn, const std::string& nameIn):
+ minxSrc(minxSrcIn), minySrc(minySrcIn), maxxSrc(maxxSrcIn), maxySrc(maxySrcIn),
+ minxDst(minxDstIn), minyDst(minyDstIn), maxxDst(maxxDstIn), maxyDst(maxyDstIn),
+ pj(pjIn), name(nameIn) {}
+
+ CoordOperation(const CoordOperation&) = delete;
+
+ CoordOperation(CoordOperation&& other):
+ minxSrc(other.minxSrc), minySrc(other.minySrc), maxxSrc(other.maxxSrc), maxySrc(other.maxySrc),
+ minxDst(other.minxDst), minyDst(other.minyDst), maxxDst(other.maxxDst), maxyDst(other.maxyDst),
+ name(std::move(other.name)) {
+ pj = other.pj;
+ other.pj = nullptr;
+ }
+
+ CoordOperation& operator=(const CoordOperation&) = delete;
+
+ ~CoordOperation()
+ {
+ proj_destroy(pj);
+ }
+ };
+ std::vector<CoordOperation> alternativeCoordinateOperations{};
+ int iCurCoordOp = -1;
+
+ /*************************************************************************************
E N D O F G E N E R A L P A R A M E T E R S T R U C T