aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-05-21 16:08:50 +0200
committerGitHub <noreply@github.com>2019-05-21 16:08:50 +0200
commit4c910ec2cd8ef07ef456d60b6bd00e2eec115dff (patch)
treeecb7455f6f961f7de121d261924b7ecab544fda8 /test/unit
parent573e57a8b323d9e5455ed30a4bf11b4cb265f59d (diff)
parent5727a6c2f57dcca75b4f0742ea25ad143a50812f (diff)
downloadPROJ-4c910ec2cd8ef07ef456d60b6bd00e2eec115dff.tar.gz
PROJ-4c910ec2cd8ef07ef456d60b6bd00e2eec115dff.zip
Merge pull request #1478 from OSGeo/backport-1477-to-6.1
[Backport 6.1] createOperations(): avoid exception when transforming from NAD83 to projected CRS using NAD83(2011) (fixes #1474)
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_operation.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 5ac1609d..2ba76172 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -6902,6 +6902,29 @@ TEST(operation, IGNF_LAMB1_TO_EPSG_4326) {
// ---------------------------------------------------------------------------
+TEST(operation, NAD83_to_projeted_CRS_based_on_NAD83_2011) {
+ auto authFactory =
+ AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+ auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0.0);
+ ctxt->setSpatialCriterion(
+ CoordinateOperationContext::SpatialCriterion::PARTIAL_INTERSECTION);
+ auto list = CoordinateOperationFactory::create()->createOperations(
+ // NAD83
+ authFactory->createCoordinateReferenceSystem("4269"),
+ // NAD83(2011) / California Albers
+ authFactory->createCoordinateReferenceSystem("6414"), ctxt);
+ ASSERT_EQ(list.size(), 1U);
+ EXPECT_EQ(list[0]->nameStr(), "Ballpark geographic offset from NAD83 to "
+ "NAD83(2011) + California Albers");
+ EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=pipeline +step +proj=axisswap +order=2,1 "
+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
+ "+step +proj=aea +lat_0=0 +lon_0=-120 +lat_1=34 "
+ "+lat_2=40.5 +x_0=0 +y_0=-4000000 +ellps=GRS80");
+}
+
+// ---------------------------------------------------------------------------
+
TEST(operation, isPROJInstantiable) {
{