aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operation.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-28 17:56:25 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-28 17:56:25 +0100
commitd43a09983fd0c115a175613c7d77a648b0500791 (patch)
tree0f44003997d3dbfef4ed0e47778084352ba4dd33 /test/unit/test_operation.cpp
parentf49a5b744a28fe2a51cdcb7b4bc86f5d834f1e54 (diff)
downloadPROJ-d43a09983fd0c115a175613c7d77a648b0500791.tar.gz
PROJ-d43a09983fd0c115a175613c7d77a648b0500791.zip
createOperations(): allow looking for geographic CRS by name (helps with WKT 2 definitions of PROJCRS that lack it)
Diffstat (limited to 'test/unit/test_operation.cpp')
-rw-r--r--test/unit/test_operation.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 1030ba93..0c127afa 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -4260,6 +4260,32 @@ TEST(operation, geogCRS_to_geogCRS_context_default) {
// ---------------------------------------------------------------------------
+TEST(operation, geogCRS_to_geogCRS_context_match_by_name) {
+ auto authFactory =
+ AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+ auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0);
+ ctxt->setSpatialCriterion(
+ CoordinateOperationContext::SpatialCriterion::PARTIAL_INTERSECTION);
+ ctxt->setAllowUseIntermediateCRS(false);
+ auto NAD27 = GeographicCRS::create(
+ PropertyMap().set(IdentifiedObject::NAME_KEY,
+ GeographicCRS::EPSG_4267->nameStr()),
+ GeographicCRS::EPSG_4267->datum(),
+ GeographicCRS::EPSG_4267->datumEnsemble(),
+ GeographicCRS::EPSG_4267->coordinateSystem());
+ auto list = CoordinateOperationFactory::create()->createOperations(
+ NAD27, GeographicCRS::EPSG_4326, ctxt);
+ auto listInv = CoordinateOperationFactory::create()->createOperations(
+ GeographicCRS::EPSG_4326, NAD27, ctxt);
+ auto listRef = CoordinateOperationFactory::create()->createOperations(
+ GeographicCRS::EPSG_4267, GeographicCRS::EPSG_4326, ctxt);
+ EXPECT_EQ(list.size(), listRef.size());
+ EXPECT_EQ(listInv.size(), listRef.size());
+ EXPECT_GE(listRef.size(), 2U);
+}
+
+// ---------------------------------------------------------------------------
+
TEST(operation, geogCRS_to_geogCRS_context_filter_accuracy) {
auto authFactory =
AuthorityFactory::create(DatabaseContext::create(), "EPSG");