aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2019-09-24 09:27:49 +0200
committerGitHub <noreply@github.com>2019-09-24 09:27:49 +0200
commitda2163996edcf9383d32261e48f11bafc273b9d7 (patch)
tree75770f799881540488861e13fa76c2cd6d74099a /src
parenta71fce63c2d77b6709005667efd577d728b900e9 (diff)
parent0f4f7870d8a8db3f8036ebbc96291c66eac2cd5e (diff)
downloadPROJ-da2163996edcf9383d32261e48f11bafc273b9d7.tar.gz
PROJ-da2163996edcf9383d32261e48f11bafc273b9d7.zip
Database: update to EPSG 9.8.2 (#1633)
Database: update to EPSG 9.8.2
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/coordinateoperation.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index 56a3b38c..bf3b5146 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -10267,6 +10267,7 @@ CoordinateOperationPtr CoordinateOperationFactory::createOperation(
struct PrecomputedOpCharacteristics {
double area_{};
double accuracy_{};
+ bool isPROJExportable_ = false;
bool hasGrids_ = false;
bool gridsAvailable_ = false;
bool gridsKnown_ = false;
@@ -10275,13 +10276,14 @@ struct PrecomputedOpCharacteristics {
bool isNullTransformation_ = false;
PrecomputedOpCharacteristics() = default;
- PrecomputedOpCharacteristics(double area, double accuracy, bool hasGrids,
+ PrecomputedOpCharacteristics(double area, double accuracy,
+ bool isPROJExportable, bool hasGrids,
bool gridsAvailable, bool gridsKnown,
size_t stepCount, bool isApprox,
bool isNullTransformation)
- : area_(area), accuracy_(accuracy), hasGrids_(hasGrids),
- gridsAvailable_(gridsAvailable), gridsKnown_(gridsKnown),
- stepCount_(stepCount), isApprox_(isApprox),
+ : area_(area), accuracy_(accuracy), isPROJExportable_(isPROJExportable),
+ hasGrids_(hasGrids), gridsAvailable_(gridsAvailable),
+ gridsKnown_(gridsKnown), stepCount_(stepCount), isApprox_(isApprox),
isNullTransformation_(isNullTransformation) {}
};
@@ -10309,6 +10311,15 @@ struct SortFunction {
// CAUTION: the order of the comparisons is extremely important
// to get the intended result.
+ if (iterA->second.isPROJExportable_ &&
+ !iterB->second.isPROJExportable_) {
+ return true;
+ }
+ if (!iterA->second.isPROJExportable_ &&
+ iterB->second.isPROJExportable_) {
+ return false;
+ }
+
if (!iterA->second.isApprox_ && iterB->second.isApprox_) {
return true;
}
@@ -10686,9 +10697,21 @@ struct FilterResults {
std::string::npos ||
op->nameStr().find(BALLPARK_GEOCENTRIC_TRANSLATION) !=
std::string::npos;
+
+ bool isPROJExportable = false;
+ auto formatter = io::PROJStringFormatter::create();
+ try {
+ op->exportToPROJString(formatter.get());
+ // Grids might be missing, but at least this is something
+ // PROJ could potentially process
+ isPROJExportable = true;
+ } catch (const std::exception &) {
+ }
+
map[op.get()] = PrecomputedOpCharacteristics(
- area, getAccuracy(op), hasGrids, gridsAvailable, gridsKnown,
- stepCount, isApprox, isNullTransformation);
+ area, getAccuracy(op), isPROJExportable, hasGrids,
+ gridsAvailable, gridsKnown, stepCount, isApprox,
+ isNullTransformation);
}
// Sort !