aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-22 22:09:26 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-22 22:31:44 +0100
commitffcd6253bb6b275cfc8884eeb88aa2eeac75e3b6 (patch)
treecd279a62afef8567235ee6ad37ff1d38c75db7b8 /test/unit
parentdb31b6dfa9c8fe37d5706d95ce81012b8db3c3b9 (diff)
downloadPROJ-ffcd6253bb6b275cfc8884eeb88aa2eeac75e3b6.tar.gz
PROJ-ffcd6253bb6b275cfc8884eeb88aa2eeac75e3b6.zip
Database: update to EPSG v9.8.6
Fixes #1867
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_c_api.cpp12
-rw-r--r--test/unit/test_factory.cpp2
-rw-r--r--test/unit/test_operation.cpp51
3 files changed, 57 insertions, 8 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index 5c6dabba..df0bffb0 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -3333,9 +3333,11 @@ TEST_F(CApi, proj_get_crs_info_list_from_database) {
ASSERT_NE(list, nullptr);
EXPECT_GT(result_count, 1);
for (int i = 0; i < result_count; i++) {
- EXPECT_LE(list[i]->west_lon_degree, params->west_lon_degree);
+ if (list[i]->west_lon_degree < list[i]->east_lon_degree) {
+ EXPECT_LE(list[i]->west_lon_degree, params->west_lon_degree);
+ EXPECT_GE(list[i]->east_lon_degree, params->east_lon_degree);
+ }
EXPECT_LE(list[i]->south_lat_degree, params->south_lat_degree);
- EXPECT_GE(list[i]->east_lon_degree, params->east_lon_degree);
EXPECT_GE(list[i]->north_lat_degree, params->north_lat_degree);
}
proj_get_crs_list_parameters_destroy(params);
@@ -3360,9 +3362,11 @@ TEST_F(CApi, proj_get_crs_info_list_from_database) {
ASSERT_NE(list, nullptr);
EXPECT_GT(result_count, 1);
for (int i = 0; i < result_count; i++) {
- EXPECT_LE(list[i]->west_lon_degree, params->east_lon_degree);
+ if (list[i]->west_lon_degree < list[i]->east_lon_degree) {
+ EXPECT_LE(list[i]->west_lon_degree, params->west_lon_degree);
+ EXPECT_GE(list[i]->east_lon_degree, params->east_lon_degree);
+ }
EXPECT_LE(list[i]->south_lat_degree, params->north_lat_degree);
- EXPECT_GE(list[i]->east_lon_degree, params->west_lon_degree);
EXPECT_GE(list[i]->north_lat_degree, params->south_lat_degree);
}
proj_get_crs_list_parameters_destroy(params);
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp
index 6a88e2b6..33b72efd 100644
--- a/test/unit/test_factory.cpp
+++ b/test/unit/test_factory.cpp
@@ -940,7 +940,7 @@ TEST(
" BBOX[-22.37,166.35,-22.19,166.54]],\n"
" ID[\"EPSG\",1295],\n"
" REMARK[\"Emulation using NTv2 method of tfm NEA74 Noumea to "
- "RGNC91-93 (3) (code 15943). Note reversal of sign of parameter values "
+ "RGNC91-93 (3) (code 9328). Note reversal of sign of parameter values "
"in grid file.\"]]";
EXPECT_EQ(
op->exportToWKT(
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 8ee5814b..495c80c3 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -8062,7 +8062,6 @@ TEST(operation, compoundCRS_from_WKT2_no_id_to_geogCRS_3D_context) {
ASSERT_GE(list.size(), 1U);
{
- // Important here is vgridshift before hgridshift
auto op_proj =
list[0]->exportToPROJString(PROJStringFormatter::create().get());
EXPECT_EQ(
@@ -8070,8 +8069,8 @@ TEST(operation, compoundCRS_from_WKT2_no_id_to_geogCRS_3D_context) {
"+proj=pipeline +step +inv +proj=sterea +lat_0=52.1561605555556 "
"+lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 "
"+ellps=bessel "
- "+step +proj=vgridshift +grids=naptrans2008.gtx +multiplier=1 "
- "+step +proj=hgridshift +grids=rdtrans2008.gsb "
+ "+step +proj=hgridshift +grids=rdtrans2018.gsb "
+ "+step +proj=vgridshift +grids=nlgeo2018.gtx +multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
}
@@ -9651,3 +9650,49 @@ TEST(operation, normalizeForVisualization) {
"+step +proj=unitconvert +xy_in=rad +xy_out=deg");
}
}
+
+// ---------------------------------------------------------------------------
+
+TEST(operation,
+ export_of_Geographic3D_to_GravityRelatedHeight_gtx_unknown_grid) {
+
+ auto wkt =
+ "COORDINATEOPERATION[\"bla\",\n"
+ " SOURCECRS[\n"
+ " GEOGCRS[\"ETRS89\",\n"
+ " DATUM[\"European Terrestrial Reference System 1989\",\n"
+ " ELLIPSOID[\"GRS 1980\",6378137,298.257222101,\n"
+ " LENGTHUNIT[\"metre\",1]]],\n"
+ " PRIMEM[\"Greenwich\",0,\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " CS[ellipsoidal,3],\n"
+ " AXIS[\"geodetic latitude (Lat)\",north,\n"
+ " ORDER[1],\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " AXIS[\"geodetic longitude (Lon)\",east,\n"
+ " ORDER[2],\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " AXIS[\"ellipsoidal height (h)\",up,\n"
+ " ORDER[3],\n"
+ " LENGTHUNIT[\"metre\",1]],\n"
+ " ID[\"EPSG\",4937]]],\n"
+ " TARGETCRS[\n"
+ " VERTCRS[\"bar\",\n"
+ " VDATUM[\"bar\"],\n"
+ " CS[vertical,1],\n"
+ " AXIS[\"gravity-related height (H)\",up,\n"
+ " LENGTHUNIT[\"metre\",1]]]],\n"
+ " METHOD[\"Geographic3D to GravityRelatedHeight (gtx)\",\n"
+ " ID[\"EPSG\",9665]],\n"
+ " PARAMETERFILE[\"Geoid (height correction) model "
+ "file\",\"foo.gtx\"]]";
+
+ auto obj = WKTParser().createFromWKT(wkt);
+ auto crs = nn_dynamic_pointer_cast<Transformation>(obj);
+ ASSERT_TRUE(crs != nullptr);
+ // Test that even if the .gtx file is unkown, we export in the correct
+ // direction
+ EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=pipeline +step +inv +proj=vgridshift +grids=foo.gtx "
+ "+multiplier=1");
+}