aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-09-16 12:01:39 +0200
committerGitHub <noreply@github.com>2021-09-16 12:01:39 +0200
commita3e412995df7dae2c8ef13d2682e03b770edcb75 (patch)
tree751cd21521ee33e002222b165c1938990d1b0bac /test/unit
parente54739954db813cd8394066b1e64ae8f2dd76bd8 (diff)
parent85f496b26702bf6566296072795e821d70156c09 (diff)
downloadPROJ-a3e412995df7dae2c8ef13d2682e03b770edcb75.tar.gz
PROJ-a3e412995df7dae2c8ef13d2682e03b770edcb75.zip
Merge pull request #2851 from rouault/epsg_10_035
Database: update to EPSG v10.035
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_c_api.cpp13
-rw-r--r--test/unit/test_crs.cpp16
-rw-r--r--test/unit/test_factory.cpp2
-rw-r--r--test/unit/test_io.cpp2
-rw-r--r--test/unit/test_operationfactory.cpp48
5 files changed, 37 insertions, 44 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index 600f47ff..4898345c 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -5033,13 +5033,12 @@ TEST_F(CApi, proj_create_vertical_crs_ex_with_geog_crs) {
auto name = proj_get_name(P);
ASSERT_TRUE(name != nullptr);
- EXPECT_EQ(
- name,
- std::string("Inverse of UTM zone 11N + "
- "Ballpark geographic offset from NAD83(2011) to WGS 84 + "
- "Conversion from myVertCRS to myVertCRS (metre) + "
- "Transformation from myVertCRS (metre) to WGS 84 + "
- "Ballpark geographic offset from WGS 84 to NAD83(2011)"));
+ EXPECT_EQ(name,
+ std::string("Inverse of UTM zone 11N + "
+ "NAD83(2011) to WGS 84 (1) + "
+ "Conversion from myVertCRS to myVertCRS (metre) + "
+ "Transformation from myVertCRS (metre) to WGS 84 + "
+ "Inverse of NAD83(2011) to WGS 84 (1)"));
auto proj_5 = proj_as_proj_string(m_ctxt, P, PJ_PROJ_5, nullptr);
ASSERT_NE(proj_5, nullptr);
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index 2ac26d3a..42e6018b 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -2911,9 +2911,14 @@ TEST(crs, projectedCRS_identify_db) {
ASSERT_TRUE(crs != nullptr);
auto factoryAll = AuthorityFactory::create(dbContext, std::string());
auto res = crs->identify(factoryAll);
- ASSERT_GE(res.size(), 1U);
- EXPECT_EQ(res.front().first->getEPSGCode(), 2154);
- EXPECT_EQ(res.front().second, 90);
+ bool found = false;
+ for (const auto &candidate : res) {
+ if (candidate.first->getEPSGCode() == 2154) {
+ found = true;
+ EXPECT_EQ(candidate.second, 90);
+ }
+ }
+ EXPECT_TRUE(found);
}
{
// Identify with DatumEnsemble
@@ -6034,6 +6039,10 @@ TEST(crs, crs_createBoundCRSToWGS84IfPossible) {
"+proj=longlat +datum=WGS84 +geoidgrids=us_nga_egm08_25.tif "
"+vunits=m +no_defs +type=crs");
}
+#ifdef disabled_since_epsg_10_035
+ // There are now too many transformations from NGF-IGN69 height to WGS 84
+ // for createBoundCRSToWGS84IfPossible() to be able to select a
+ // vertical geoidgrid
{
// NTF (Paris) / Lambert zone II + NGF-IGN69 height
auto crs_7421 = factory->createCoordinateReferenceSystem("7421");
@@ -6053,6 +6062,7 @@ TEST(crs, crs_createBoundCRSToWGS84IfPossible) {
"+towgs84=-168,-60,320,0,0,0,0 +units=m "
"+geoidgrids=fr_ign_RAF18.tif +vunits=m +no_defs +type=crs");
}
+#endif
{
auto crs = createVerticalCRS();
EXPECT_EQ(crs->createBoundCRSToWGS84IfPossible(
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp
index 32afe0b5..1ecea9d6 100644
--- a/test/unit/test_factory.cpp
+++ b/test/unit/test_factory.cpp
@@ -1552,7 +1552,7 @@ TEST(factory, AuthorityFactory_getDescriptionText) {
EXPECT_THROW(factory->getDescriptionText("-1"),
NoSuchAuthorityCodeException);
EXPECT_EQ(factory->getDescriptionText("10000"),
- "RGF93 to NGF-IGN69 height (1)");
+ "RGF93 v1 to NGF-IGN69 height (1)");
// Several objects have 4326 code, including an area of use, but return
// the CRS one.
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp
index a4fb5f6e..ed059fe3 100644
--- a/test/unit/test_io.cpp
+++ b/test/unit/test_io.cpp
@@ -6389,7 +6389,7 @@ TEST(wkt_parse, wkt1_oracle) {
auto res = crs->identify(factoryAll);
ASSERT_GE(res.size(), 1U);
EXPECT_EQ(res.front().first->getEPSGCode(), 2154);
- EXPECT_EQ(res.front().second, 100);
+ EXPECT_EQ(res.front().second, 90);
}
// ---------------------------------------------------------------------------
diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp
index b50542c6..2ee5a53c 100644
--- a/test/unit/test_operationfactory.cpp
+++ b/test/unit/test_operationfactory.cpp
@@ -880,7 +880,7 @@ TEST(operation, geogCRS_to_geogCRS_context_concatenated_operation) {
ctxt);
ASSERT_EQ(list.size(), 4U);
- EXPECT_EQ(list[0]->nameStr(), "NTF (Paris) to RGF93 (1)");
+ EXPECT_EQ(list[0]->nameStr(), "NTF (Paris) to RGF93 v1 (1)");
EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
@@ -895,7 +895,7 @@ TEST(operation, geogCRS_to_geogCRS_context_concatenated_operation) {
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
- EXPECT_EQ(list[1]->nameStr(), "NTF (Paris) to RGF93 (2)");
+ EXPECT_EQ(list[1]->nameStr(), "NTF (Paris) to RGF93 v1 (2)");
EXPECT_EQ(list[1]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline +step +proj=axisswap +order=2,1 +step "
"+proj=unitconvert +xy_in=grad +xy_out=rad +step +inv "
@@ -1485,7 +1485,7 @@ TEST(operation, geogCRS_3D_to_geogCRS_3D_different_datum_context) {
ctxt);
ASSERT_GE(list.size(), 1U);
EXPECT_EQ(list[0]->nameStr(),
- "RGF93 to ETRS89 (1) + Inverse of CH1903+ to ETRS89 (1)");
+ "RGF93 v1 to ETRS89 (1) + Inverse of CH1903+ to ETRS89 (1)");
// Check that there is no +push +v_3
EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline "
@@ -1526,8 +1526,8 @@ TEST(operation, geocentric_to_geogCRS_3D_different_datum_context) {
ctxt);
ASSERT_GE(list.size(), 1U);
EXPECT_EQ(list[0]->nameStr(),
- "Conversion from RGF93 (geocentric) to RGF93 (geog3D) + "
- "RGF93 to ETRS89 (1) + "
+ "Conversion from RGF93 v1 (geocentric) to RGF93 v1 (geog3D) + "
+ "RGF93 v1 to ETRS89 (1) + "
"Inverse of CH1903+ to ETRS89 (1)");
// Check that there is no +push +v_3
EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
@@ -3759,7 +3759,7 @@ TEST(operation,
if (op->nameStr() ==
"Inverse of unnamed + "
"Transformation from NAD83 to WGS84 + "
- "Ballpark geographic offset from WGS 84 to NAD83(2011) + "
+ "Inverse of NAD83(2011) to WGS 84 (1) + "
"Conversion from NAVD88 height (ftUS) to NAVD88 height + "
"Inverse of NAD83(2011) to NAVD88 height (1) + "
"Conversion from NAD83(2011) (geog3D) to NAD83(2011) "
@@ -4834,9 +4834,8 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"Geoid09 hybrid model. Replaced by 2012 model (CT code 6326)."
"\n"
"For NAD83(NSRS2007) to WGS 84 (1) (EPSG:15931): "
- "Approximation at the +/- 1m level assuming that "
- "NAD83(NSRS2007) is equivalent to WGS 84 within the accuracy "
- "of the transformation.");
+ "Approximation assuming that NAD83(NSRS2007) is equivalent "
+ "to WGS 84 within the accuracy of the transformation.");
}
// NAD83 + NAVD88 height --> WGS 84
@@ -4898,14 +4897,14 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
auto list = CoordinateOperationFactory::create()->createOperations(
nnSrc,
- authFactory->createCoordinateReferenceSystem("4979"), // WGS 84
+ authFactory->createCoordinateReferenceSystem("4985"), // WGS 72 3D
ctxt);
- ASSERT_GE(list.size(), 2U);
+ ASSERT_GE(list.size(), 1U);
EXPECT_EQ(list[0]->nameStr(),
"Inverse of NAD83(2011) to NAVD88 height (3) + "
- "Inverse of NAD83 to NAD83(2011) (1) + "
- "NAD83 to WGS 84 (1)");
+ "NAD83(2011) to WGS 84 (1) + "
+ "Inverse of WGS 72 to WGS 84 (2)");
EXPECT_EQ(list[0]->exportToPROJString(
PROJStringFormatter::create(
PROJStringFormatter::Convention::PROJ_5,
@@ -4916,25 +4915,10 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
"+step +proj=vgridshift +grids=us_noaa_g2018u0.tif "
"+multiplier=1 "
- "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
- "+step +proj=axisswap +order=2,1");
-
- // Shows vertical step, and then horizontal step
- EXPECT_EQ(list[1]->nameStr(),
- "Inverse of NAD83(2011) to NAVD88 height (3) + "
- "Inverse of NAD83 to NAD83(2011) (1) + "
- "NAD83 to WGS 84 (18)");
- EXPECT_EQ(list[1]->exportToPROJString(
- PROJStringFormatter::create(
- PROJStringFormatter::Convention::PROJ_5,
- authFactory->databaseContext())
- .get()),
- "+proj=pipeline "
- "+step +proj=axisswap +order=2,1 "
- "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=us_noaa_g2018u0.tif "
- "+multiplier=1 "
- "+step +proj=hgridshift +grids=us_noaa_FL.tif "
+ "+step +proj=cart +ellps=WGS84 "
+ "+step +inv +proj=helmert +x=0 +y=0 +z=4.5 +rx=0 +ry=0 "
+ "+rz=0.554 +s=0.219 +convention=position_vector "
+ "+step +inv +proj=cart +ellps=WGS72 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
}