aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-29 12:51:49 +0100
committerGitHub <noreply@github.com>2020-01-29 12:51:49 +0100
commitbf6b1a889b12d7ecdcb190cd14155e09e132095f (patch)
treef742983990ca914ff3044352efd4e01eef5bd01d /test/unit
parent74a10a8de03deb823690f143e191087bf7c4821f (diff)
parentb113d0825cf82f66f738746db0f21745017552e9 (diff)
downloadPROJ-bf6b1a889b12d7ecdcb190cd14155e09e132095f.tar.gz
PROJ-bf6b1a889b12d7ecdcb190cd14155e09e132095f.zip
Merge pull request #1891 from rouault/rfc5
Implement RFC5: Adopt GeoTIFF-based grids for grids delivered with PROJ
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_c_api.cpp16
-rw-r--r--test/unit/test_factory.cpp4
-rw-r--r--test/unit/test_network.cpp65
-rw-r--r--test/unit/test_operation.cpp168
4 files changed, 140 insertions, 113 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index df0bffb0..b74e5cf0 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -1298,12 +1298,10 @@ TEST_F(CApi, proj_coordoperation_get_grid_used) {
ASSERT_NE(fullName, nullptr);
ASSERT_NE(packageName, nullptr);
ASSERT_NE(url, nullptr);
- EXPECT_EQ(shortName, std::string("ntv1_can.dat"));
+ EXPECT_EQ(shortName, std::string("ca_nrc_ntv1_can.tif"));
// EXPECT_EQ(fullName, std::string(""));
- EXPECT_EQ(packageName, std::string("proj-datumgrid"));
- EXPECT_TRUE(std::string(url).find(
- "https://download.osgeo.org/proj/proj-datumgrid-") == 0)
- << std::string(url);
+ EXPECT_EQ(packageName, std::string(""));
+ EXPECT_EQ(std::string(url), "https://cdn.proj.org/ca_nrc_ntv1_can.tif");
EXPECT_EQ(directDownload, 1);
EXPECT_EQ(openLicense, 1);
}
@@ -3105,8 +3103,8 @@ TEST_F(CApi, proj_grid_get_info_from_database) {
}
{
EXPECT_TRUE(proj_grid_get_info_from_database(
- m_ctxt, "GDA94_GDA2020_conformal.gsb", nullptr, nullptr, nullptr,
- nullptr, nullptr, nullptr));
+ m_ctxt, "au_icsm_GDA94_GDA2020_conformal.tif", nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr));
}
{
const char *name = nullptr;
@@ -3116,8 +3114,8 @@ TEST_F(CApi, proj_grid_get_info_from_database) {
int open_license = 0;
int available = 0;
EXPECT_TRUE(proj_grid_get_info_from_database(
- m_ctxt, "GDA94_GDA2020_conformal.gsb", &name, &package_name, &url,
- &direct_download, &open_license, &available));
+ m_ctxt, "au_icsm_GDA94_GDA2020_conformal.tif", &name, &package_name,
+ &url, &direct_download, &open_license, &available));
ASSERT_NE(name, nullptr);
ASSERT_NE(package_name, nullptr);
ASSERT_NE(url, nullptr);
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp
index d49db5bf..10c06e81 100644
--- a/test/unit/test_factory.cpp
+++ b/test/unit/test_factory.cpp
@@ -2245,6 +2245,7 @@ TEST_F(FactoryWithTmpDatabase, lookForGridInfo) {
ASSERT_TRUE(execute("INSERT INTO grid_alternatives(original_grid_name,"
"proj_grid_name, "
+ "old_proj_grid_name, "
"proj_grid_format, "
"proj_method, "
"inverse_direction, "
@@ -2252,7 +2253,8 @@ TEST_F(FactoryWithTmpDatabase, lookForGridInfo) {
"url, direct_download, open_license, directory) "
"VALUES ('null', "
"'PROJ_fake_grid', "
- "'CTable2', "
+ "'old_PROJ_fake_grid', "
+ "'NTv2', "
"'hgridshift', "
"0, "
"NULL, "
diff --git a/test/unit/test_network.cpp b/test/unit/test_network.cpp
index 241e6bbc..35dd2b1e 100644
--- a/test/unit/test_network.cpp
+++ b/test/unit/test_network.cpp
@@ -65,7 +65,7 @@ TEST(networking, initial_check) {
if (!hCurlHandle)
return;
curl_easy_setopt(hCurlHandle, CURLOPT_URL,
- "https://cdn.proj.org/ntf_r93.tif");
+ "https://cdn.proj.org/fr_ign_ntf_r93.tif");
curl_easy_setopt(hCurlHandle, CURLOPT_RANGE, "0-1");
curl_easy_setopt(hCurlHandle, CURLOPT_WRITEFUNCTION, noop_curl_write_func);
@@ -95,7 +95,7 @@ TEST(networking, basic) {
const char *pipeline =
"+proj=pipeline "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=hgridshift +grids=https://cdn.proj.org/ntf_r93.tif "
+ "+step +proj=hgridshift +grids=https://cdn.proj.org/fr_ign_ntf_r93.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg";
// network access disabled by default
@@ -1055,6 +1055,10 @@ TEST(networking, simul_file_change_while_opened) {
#ifdef CURL_ENABLED
TEST(networking, curl_hgridshift) {
+ if (!networkAccessOK) {
+ return;
+ }
+
auto ctx = proj_context_create();
proj_grid_cache_set_enable(ctx, false);
proj_context_set_enable_network(ctx, true);
@@ -1086,6 +1090,10 @@ TEST(networking, curl_hgridshift) {
#ifdef CURL_ENABLED
TEST(networking, curl_vgridshift) {
+ if (!networkAccessOK) {
+ return;
+ }
+
auto ctx = proj_context_create();
proj_grid_cache_set_enable(ctx, false);
proj_context_set_enable_network(ctx, true);
@@ -1118,6 +1126,10 @@ TEST(networking, curl_vgridshift) {
#ifdef CURL_ENABLED
TEST(networking, curl_vgridshift_vertcon) {
+ if (!networkAccessOK) {
+ return;
+ }
+
auto ctx = proj_context_create();
proj_grid_cache_set_enable(ctx, false);
proj_context_set_enable_network(ctx, true);
@@ -1239,7 +1251,7 @@ TEST(networking, cache_basic) {
const char *pipeline =
"+proj=pipeline "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=hgridshift +grids=https://cdn.proj.org/ntf_r93.tif "
+ "+step +proj=hgridshift +grids=https://cdn.proj.org/fr_ign_ntf_r93.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg";
auto ctx = proj_context_create();
@@ -1265,7 +1277,7 @@ TEST(networking, cache_basic) {
const char *url =
reinterpret_cast<const char *>(sqlite3_column_text(hStmt, 0));
ASSERT_NE(url, nullptr);
- ASSERT_EQ(std::string(url), "https://cdn.proj.org/ntf_r93.tif");
+ ASSERT_EQ(std::string(url), "https://cdn.proj.org/fr_ign_ntf_r93.tif");
ASSERT_EQ(sqlite3_column_int64(hStmt, 1), 0);
sqlite3_finalize(hStmt);
sqlite3_close(hDB);
@@ -1292,7 +1304,7 @@ TEST(networking, proj_grid_cache_clear) {
const char *pipeline =
"+proj=pipeline "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=hgridshift +grids=https://cdn.proj.org/ntf_r93.tif "
+ "+step +proj=hgridshift +grids=https://cdn.proj.org/fr_ign_ntf_r93.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg";
proj_cleanup();
@@ -1343,7 +1355,7 @@ TEST(networking, cache_saturation) {
const char *pipeline =
"+proj=pipeline "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=hgridshift +grids=https://cdn.proj.org/ntf_r93.tif "
+ "+step +proj=hgridshift +grids=https://cdn.proj.org/fr_ign_ntf_r93.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg";
proj_cleanup();
@@ -1405,7 +1417,7 @@ TEST(networking, cache_ttl) {
const char *pipeline =
"+proj=pipeline "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=hgridshift +grids=https://cdn.proj.org/ntf_r93.tif "
+ "+step +proj=hgridshift +grids=https://cdn.proj.org/fr_ign_ntf_r93.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg";
proj_cleanup();
@@ -1508,7 +1520,7 @@ TEST(networking, cache_lock) {
const char *pipeline =
"+proj=pipeline "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=hgridshift +grids=https://cdn.proj.org/ntf_r93.tif "
+ "+step +proj=hgridshift +grids=https://cdn.proj.org/fr_ign_ntf_r93.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg";
proj_cleanup();
@@ -1574,7 +1586,7 @@ TEST(networking, download_whole_files) {
proj_cleanup();
unlink("proj_test_tmp/cache.db");
- unlink("proj_test_tmp/dvr90.tif");
+ unlink("proj_test_tmp/dk_sdfe_dvr90.tif");
rmdir("proj_test_tmp");
putenv(const_cast<char *>("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY="));
@@ -1583,11 +1595,12 @@ TEST(networking, download_whole_files) {
auto ctx = proj_context_create();
proj_context_set_enable_network(ctx, true);
- ASSERT_TRUE(proj_is_download_needed(ctx, "dvr90.gtx", false));
+ ASSERT_TRUE(proj_is_download_needed(ctx, "dk_sdfe_dvr90.tif", false));
- ASSERT_TRUE(proj_download_file(ctx, "dvr90.gtx", false, nullptr, nullptr));
+ ASSERT_TRUE(
+ proj_download_file(ctx, "dk_sdfe_dvr90.tif", false, nullptr, nullptr));
- FILE *f = fopen("proj_test_tmp/dvr90.tif", "rb");
+ FILE *f = fopen("proj_test_tmp/dk_sdfe_dvr90.tif", "rb");
ASSERT_NE(f, nullptr);
fclose(f);
@@ -1596,7 +1609,7 @@ TEST(networking, download_whole_files) {
const char *pipeline =
"+proj=pipeline "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=dvr90.gtx +multiplier=1 "
+ "+step +proj=vgridshift +grids=dk_sdfe_dvr90.tif +multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg";
auto P = proj_create(ctx, pipeline);
@@ -1612,7 +1625,7 @@ TEST(networking, download_whole_files) {
proj_context_set_enable_network(ctx, true);
- ASSERT_FALSE(proj_is_download_needed(ctx, "dvr90.gtx", false));
+ ASSERT_FALSE(proj_is_download_needed(ctx, "dk_sdfe_dvr90.tif", false));
{
sqlite3 *hDB = nullptr;
@@ -1631,7 +1644,7 @@ TEST(networking, download_whole_files) {
}
// If we ignore TTL settings, then no network access will be done
- ASSERT_FALSE(proj_is_download_needed(ctx, "dvr90.gtx", true));
+ ASSERT_FALSE(proj_is_download_needed(ctx, "dk_sdfe_dvr90.tif", true));
{
sqlite3 *hDB = nullptr;
@@ -1651,7 +1664,7 @@ TEST(networking, download_whole_files) {
}
// Should recheck from the CDN, update last_checked and do nothing
- ASSERT_FALSE(proj_is_download_needed(ctx, "dvr90.gtx", false));
+ ASSERT_FALSE(proj_is_download_needed(ctx, "dk_sdfe_dvr90.tif", false));
{
sqlite3 *hDB = nullptr;
@@ -1680,10 +1693,10 @@ TEST(networking, download_whole_files) {
sqlite3_close(hDB);
}
- ASSERT_TRUE(proj_is_download_needed(ctx, "dvr90.gtx", false));
+ ASSERT_TRUE(proj_is_download_needed(ctx, "dk_sdfe_dvr90.tif", false));
// Redo download with a progress callback this time.
- unlink("proj_test_tmp/dvr90.tif");
+ unlink("proj_test_tmp/dk_sdfe_dvr90.tif");
const auto cbk = [](PJ_CONTEXT *l_ctx, double pct, void *user_data) -> int {
auto vect = static_cast<std::vector<std::pair<PJ_CONTEXT *, double>> *>(
@@ -1693,7 +1706,8 @@ TEST(networking, download_whole_files) {
};
std::vector<std::pair<PJ_CONTEXT *, double>> vectPct;
- ASSERT_TRUE(proj_download_file(ctx, "dvr90.gtx", false, cbk, &vectPct));
+ ASSERT_TRUE(
+ proj_download_file(ctx, "dk_sdfe_dvr90.tif", false, cbk, &vectPct));
ASSERT_EQ(vectPct.size(), 3U);
ASSERT_EQ(vectPct.back().first, ctx);
ASSERT_EQ(vectPct.back().second, 1.0);
@@ -1703,7 +1717,7 @@ TEST(networking, download_whole_files) {
putenv(const_cast<char *>("PROJ_USER_WRITABLE_DIRECTORY="));
putenv(const_cast<char *>("PROJ_FULL_FILE_CHUNK_SIZE="));
unlink("proj_test_tmp/cache.db");
- unlink("proj_test_tmp/dvr90.tif");
+ unlink("proj_test_tmp/dk_sdfe_dvr90.tif");
rmdir("proj_test_tmp");
}
@@ -1716,7 +1730,7 @@ TEST(networking, file_api) {
proj_cleanup();
unlink("proj_test_tmp/cache.db");
- unlink("proj_test_tmp/dvr90.tif");
+ unlink("proj_test_tmp/dk_sdfe_dvr90.tif");
rmdir("proj_test_tmp");
putenv(const_cast<char *>("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY="));
@@ -1806,9 +1820,10 @@ TEST(networking, file_api) {
UserData userData;
ASSERT_TRUE(proj_context_set_fileapi(ctx, &api, &userData));
- ASSERT_TRUE(proj_is_download_needed(ctx, "dvr90.gtx", false));
+ ASSERT_TRUE(proj_is_download_needed(ctx, "dk_sdfe_dvr90.tif", false));
- ASSERT_TRUE(proj_download_file(ctx, "dvr90.gtx", false, nullptr, nullptr));
+ ASSERT_TRUE(
+ proj_download_file(ctx, "dk_sdfe_dvr90.tif", false, nullptr, nullptr));
ASSERT_TRUE(userData.in_open);
ASSERT_FALSE(userData.in_read);
@@ -1824,7 +1839,7 @@ TEST(networking, file_api) {
const char *pipeline =
"+proj=pipeline "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=dvr90.gtx +multiplier=1 "
+ "+step +proj=vgridshift +grids=dk_sdfe_dvr90.tif +multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg";
auto P = proj_create(ctx, pipeline);
@@ -1847,7 +1862,7 @@ TEST(networking, file_api) {
putenv(const_cast<char *>("PROJ_USER_WRITABLE_DIRECTORY="));
putenv(const_cast<char *>("PROJ_FULL_FILE_CHUNK_SIZE="));
unlink("proj_test_tmp/cache.db");
- unlink("proj_test_tmp/dvr90.tif");
+ unlink("proj_test_tmp/dk_sdfe_dvr90.tif");
rmdir("proj_test_tmp");
}
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 495c80c3..ebd306ba 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -4460,7 +4460,8 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
.get()),
"+proj=pipeline +step +proj=axisswap +order=2,1 +step "
"+proj=unitconvert +xy_in=deg +xy_out=rad +step "
- "+proj=hgridshift +grids=ntf_r93.gsb +step +proj=unitconvert "
+ "+proj=hgridshift +grids=fr_ign_ntf_r93.tif +step "
+ "+proj=unitconvert "
"+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
}
{
@@ -4478,7 +4479,8 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
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=hgridshift +grids=ntf_r93.gsb +step +proj=unitconvert "
+ "+proj=hgridshift +grids=fr_ign_ntf_r93.tif +step "
+ "+proj=unitconvert "
"+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
}
{
@@ -4496,7 +4498,8 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
list[0]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline +step +proj=axisswap +order=2,1 +step "
"+proj=unitconvert +xy_in=deg +xy_out=rad +step +inv "
- "+proj=hgridshift +grids=ntf_r93.gsb +step +proj=unitconvert "
+ "+proj=hgridshift +grids=fr_ign_ntf_r93.tif +step "
+ "+proj=unitconvert "
"+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
}
}
@@ -4521,17 +4524,18 @@ TEST(operation, geogCRS_to_geogCRS_context_ntv1_ntv2_ctable2) {
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=hgridshift "
- "+grids=ntv1_can.dat +step +proj=unitconvert +xy_in=rad "
+ "+grids=ca_nrc_ntv1_can.tif +step +proj=unitconvert +xy_in=rad "
"+xy_out=deg +step +proj=axisswap +order=2,1");
EXPECT_EQ(list[1]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline +step +proj=axisswap +order=2,1 +step "
"+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift "
- "+grids=ntv2_0.gsb +step +proj=unitconvert +xy_in=rad "
+ "+grids=ca_nrc_ntv2_0.tif +step +proj=unitconvert +xy_in=rad "
"+xy_out=deg +step +proj=axisswap +order=2,1");
EXPECT_EQ(list[2]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline +step +proj=axisswap +order=2,1 +step "
"+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift "
- "+grids=conus +step +proj=unitconvert +xy_in=rad +xy_out=deg "
+ "+grids=us_noaa_conus.tif +step +proj=unitconvert +xy_in=rad "
+ "+xy_out=deg "
"+step +proj=axisswap +order=2,1");
}
@@ -4587,7 +4591,7 @@ TEST(operation, geogCRS_to_geogCRS_context_NAD27_to_WGS84_G1762) {
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=hgridshift +grids=ntv2_0.gsb "
+ "+step +proj=hgridshift +grids=ca_nrc_ntv2_0.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
EXPECT_EQ(list[1]->nameStr(),
@@ -4676,7 +4680,7 @@ TEST(operation, vertCRS_to_geogCRS_context) {
PROJStringFormatter::Convention::PROJ_5,
authFactory->databaseContext())
.get()),
- "+proj=vgridshift +grids=egm08_25.gtx +multiplier=1");
+ "+proj=vgridshift +grids=us_nga_egm08_25.tif +multiplier=1");
}
{
auto ctxt =
@@ -4689,7 +4693,7 @@ TEST(operation, vertCRS_to_geogCRS_context) {
ASSERT_EQ(list.size(), 2U);
EXPECT_EQ(
list[0]->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=vgridshift +grids=egm08_25.gtx +multiplier=1");
+ "+proj=vgridshift +grids=us_nga_egm08_25.tif +multiplier=1");
}
{
auto ctxt =
@@ -4702,7 +4706,8 @@ TEST(operation, vertCRS_to_geogCRS_context) {
ASSERT_EQ(list.size(), 2U);
EXPECT_EQ(
list[0]->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=pipeline +step +inv +proj=vgridshift +grids=egm08_25.gtx "
+ "+proj=pipeline +step +inv +proj=vgridshift "
+ "+grids=us_nga_egm08_25.tif "
"+multiplier=1");
}
{
@@ -4728,7 +4733,7 @@ TEST(operation, vertCRS_to_geogCRS_context) {
ASSERT_EQ(list.size(), 1U);
EXPECT_EQ(
list[0]->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=vgridshift +grids=nzgeoid2016.gtx +multiplier=1");
+ "+proj=vgridshift +grids=nz_linz_nzgeoid2016.tif +multiplier=1");
}
}
@@ -4827,7 +4832,7 @@ TEST(operation, geogCRS_to_geogCRS_context_concatenated_operation) {
"+proj=pipeline +step +proj=axisswap +order=2,1 +step "
"+proj=unitconvert +xy_in=grad +xy_out=rad +step +inv "
"+proj=longlat +ellps=clrk80ign +pm=paris +step +proj=hgridshift "
- "+grids=ntf_r93.gsb +step +proj=unitconvert +xy_in=rad "
+ "+grids=fr_ign_ntf_r93.tif +step +proj=unitconvert +xy_in=rad "
"+xy_out=deg +step +proj=axisswap +order=2,1");
EXPECT_TRUE(nn_dynamic_pointer_cast<ConcatenatedOperation>(list[0]) !=
@@ -4875,7 +4880,7 @@ TEST(operation, geogCRS_to_geogCRS_context_same_grid_name) {
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=hgridshift "
- "+grids=BETA2007.gsb +step +proj=unitconvert +xy_in=rad "
+ "+grids=de_adv_BETA2007.tif +step +proj=unitconvert +xy_in=rad "
"+xy_out=deg +step +proj=axisswap +order=2,1");
}
@@ -4919,7 +4924,7 @@ TEST(operation, geogCRS_to_geogCRS_CH1903_to_CH1903plus_context) {
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=hgridshift +grids=CHENyx06a.gsb "
+ "+step +proj=hgridshift +grids=ch_swisstopo_CHENyx06a.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
@@ -4973,7 +4978,7 @@ TEST(operation, geogCRS_to_geogCRS_init_IGNF_to_init_IGNF_context) {
"NOUVELLE TRIANGULATION DE LA FRANCE (NTF) vers RGF93 (ETRS89)");
EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=hgridshift +grids=ntf_r93.gsb +step "
+ "+step +proj=hgridshift +grids=fr_ign_ntf_r93.tif +step "
"+proj=unitconvert +xy_in=rad +xy_out=deg");
}
@@ -5541,11 +5546,12 @@ TEST(operation,
"NTF (Paris) to NTF (1) + Inverse of WGS 84 to NTF (3) + UTM zone 31N");
ASSERT_EQ(list[0]->coordinateOperationAccuracies().size(), 1U);
EXPECT_EQ(list[0]->coordinateOperationAccuracies()[0]->value(), "1");
- EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
- "+proj=unitconvert +xy_in=grad +xy_out=rad +step +inv "
- "+proj=longlat +ellps=clrk80ign +pm=paris +step +proj=hgridshift "
- "+grids=ntf_r93.gsb +step +proj=utm +zone=31 +ellps=WGS84");
+ EXPECT_EQ(
+ list[0]->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
+ "+proj=unitconvert +xy_in=grad +xy_out=rad +step +inv "
+ "+proj=longlat +ellps=clrk80ign +pm=paris +step +proj=hgridshift "
+ "+grids=fr_ign_ntf_r93.tif +step +proj=utm +zone=31 +ellps=WGS84");
}
// ---------------------------------------------------------------------------
@@ -6497,7 +6503,7 @@ static BoundCRSNNPtr createBoundVerticalCRS() {
auto transformation =
Transformation::createGravityRelatedHeightToGeographic3D(
PropertyMap(), vertCRS, GeographicCRS::EPSG_4979, nullptr,
- "egm08_25.gtx", std::vector<PositionalAccuracyNNPtr>());
+ "us_nga_egm08_25.tif", std::vector<PositionalAccuracyNNPtr>());
return BoundCRS::create(vertCRS, GeographicCRS::EPSG_4979, transformation);
}
@@ -6506,17 +6512,14 @@ static BoundCRSNNPtr createBoundVerticalCRS() {
TEST(operation, transformation_height_to_PROJ_string) {
auto transf = createBoundVerticalCRS()->transformation();
EXPECT_EQ(transf->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=vgridshift +grids=egm08_25.gtx +multiplier=1");
+ "+proj=vgridshift +grids=us_nga_egm08_25.tif +multiplier=1");
auto grids = transf->gridsNeeded(DatabaseContext::create(), false);
ASSERT_EQ(grids.size(), 1U);
auto gridDesc = *(grids.begin());
- EXPECT_EQ(gridDesc.shortName, "egm08_25.gtx");
- EXPECT_EQ(gridDesc.packageName, "proj-datumgrid-world");
- EXPECT_TRUE(gridDesc.url.find(
- "https://download.osgeo.org/proj/proj-datumgrid-world-") ==
- 0)
- << gridDesc.url;
+ EXPECT_EQ(gridDesc.shortName, "us_nga_egm08_25.tif");
+ EXPECT_TRUE(gridDesc.packageName.empty());
+ EXPECT_EQ(gridDesc.url, "https://cdn.proj.org/us_nga_egm08_25.tif");
if (gridDesc.available) {
EXPECT_TRUE(!gridDesc.fullName.empty()) << gridDesc.fullName;
EXPECT_TRUE(gridDesc.fullName.find(gridDesc.shortName) !=
@@ -6625,7 +6628,8 @@ TEST(operation, transformation_NZLVD_to_PROJ_string) {
PROJStringFormatter::create(
PROJStringFormatter::Convention::PROJ_5, dbContext)
.get()),
- "+proj=vgridshift +grids=auckht1946-nzvd2016.gtx +multiplier=1");
+ "+proj=vgridshift +grids=nz_linz_auckht1946-nzvd2016.tif "
+ "+multiplier=1");
}
// ---------------------------------------------------------------------------
@@ -6757,11 +6761,12 @@ TEST(operation, compoundCRS_with_boundVerticalCRS_to_geogCRS) {
auto op = CoordinateOperationFactory::create()->createOperation(
compound, GeographicCRS::EPSG_4979);
ASSERT_TRUE(op != nullptr);
- EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
- "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift "
- "+grids=egm08_25.gtx +multiplier=1 +step +proj=unitconvert "
- "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
+ EXPECT_EQ(
+ op->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
+ "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift "
+ "+grids=us_nga_egm08_25.tif +multiplier=1 +step +proj=unitconvert "
+ "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
}
// ---------------------------------------------------------------------------
@@ -6816,7 +6821,7 @@ TEST(operation, compoundCRS_with_boundGeogCRS_and_boundVerticalCRS_to_geogCRS) {
"+convention=position_vector "
"+step +inv +proj=cart +ellps=WGS84 "
"+step +proj=pop +v_3 "
- "+step +proj=vgridshift +grids=egm08_25.gtx +multiplier=1 "
+ "+step +proj=vgridshift +grids=us_nga_egm08_25.tif +multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
@@ -6856,7 +6861,7 @@ TEST(operation, compoundCRS_with_boundProjCRS_and_boundVerticalCRS_to_geogCRS) {
"+convention=position_vector "
"+step +inv +proj=cart +ellps=WGS84 "
"+step +proj=pop +v_3 "
- "+step +proj=vgridshift +grids=egm08_25.gtx +multiplier=1 "
+ "+step +proj=vgridshift +grids=us_nga_egm08_25.tif +multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
@@ -7095,13 +7100,14 @@ TEST(operation, compoundCRS_to_compoundCRS_context) {
EXPECT_EQ(list[0]->nameStr(), "NGVD29 height (ftUS) to NAVD88 height (3) + "
"NAD27 to WGS 84 (79) + Inverse of "
"NAD83(NSRS2007) to WGS 84 (1)");
- EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
- "+proj=unitconvert +xy_in=deg +z_in=us-ft +xy_out=rad +z_out=m "
- "+step +proj=vgridshift +grids=vertcone.gtx +multiplier=0.001 "
- "+step +proj=hgridshift +grids=conus +step "
- "+proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap "
- "+order=2,1");
+ EXPECT_EQ(
+ list[0]->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
+ "+proj=unitconvert +xy_in=deg +z_in=us-ft +xy_out=rad +z_out=m "
+ "+step +proj=vgridshift +grids=us_noaa_vertcone.tif +multiplier=1 "
+ "+step +proj=hgridshift +grids=us_noaa_conus.tif +step "
+ "+proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap "
+ "+order=2,1");
{
// Test that we can round-trip this through WKT and still get the same
// PROJ string.
@@ -7132,12 +7138,13 @@ TEST(operation, compoundCRS_to_compoundCRS_context) {
"Transformation from NGVD29 height (ftUS) to NAVD88 "
"height (ballpark vertical transformation) + NAD27 to "
"WGS 84 (79) + Inverse of NAD83(NSRS2007) to WGS 84 (1)");
- EXPECT_EQ(projString,
- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
- "+proj=unitconvert +xy_in=deg +z_in=us-ft +xy_out=rad "
- "+z_out=m +step +proj=hgridshift +grids=conus "
- "+step +proj=unitconvert +xy_in=rad "
- "+xy_out=deg +step +proj=axisswap +order=2,1");
+ EXPECT_EQ(
+ projString,
+ "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
+ "+proj=unitconvert +xy_in=deg +z_in=us-ft +xy_out=rad "
+ "+z_out=m +step +proj=hgridshift +grids=us_noaa_conus.tif "
+ "+step +proj=unitconvert +xy_in=rad "
+ "+xy_out=deg +step +proj=axisswap +order=2,1");
foundApprox = true;
break;
}
@@ -7247,7 +7254,7 @@ TEST(operation, vertCRS_to_vertCRS_context) {
ASSERT_EQ(list.size(), 3U);
EXPECT_EQ(list[0]->nameStr(), "NGVD29 height (m) to NAVD88 height (3)");
EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=vgridshift +grids=vertcone.gtx +multiplier=0.001");
+ "+proj=vgridshift +grids=us_noaa_vertcone.tif +multiplier=1");
}
// ---------------------------------------------------------------------------
@@ -7263,7 +7270,8 @@ TEST(operation, vertCRS_to_vertCRS_New_Zealand_context) {
authFactory->createCoordinateReferenceSystem("5759"), ctxt);
ASSERT_EQ(list.size(), 1U);
EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=vgridshift +grids=auckht1946-nzvd2016.gtx +multiplier=1");
+ "+proj=vgridshift +grids=nz_linz_auckht1946-nzvd2016.tif "
+ "+multiplier=1");
}
// ---------------------------------------------------------------------------
@@ -7334,7 +7342,8 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
.get()),
"+proj=pipeline +step +proj=axisswap +order=2,1 +step "
"+proj=unitconvert +xy_in=deg +xy_out=rad +step "
- "+proj=hgridshift +grids=conus +step +proj=unitconvert "
+ "+proj=hgridshift +grids=us_noaa_conus.tif "
+ "+step +proj=unitconvert "
"+xy_in=rad +z_in=us-ft +xy_out=deg +z_out=m +step "
"+proj=axisswap +order=2,1");
}
@@ -7365,7 +7374,7 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=geoid09_conus.gtx "
+ "+step +proj=vgridshift +grids=us_noaa_geoid09_conus.tif "
"+multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
@@ -7406,7 +7415,7 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=geoid09_conus.gtx "
+ "+step +proj=vgridshift +grids=us_noaa_geoid09_conus.tif "
"+multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
@@ -7446,7 +7455,7 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=g2018u0.gtx "
+ "+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");
@@ -7464,9 +7473,9 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=g2018u0.gtx "
+ "+step +proj=vgridshift +grids=us_noaa_g2018u0.tif "
"+multiplier=1 "
- "+step +proj=hgridshift +grids=FL "
+ "+step +proj=hgridshift +grids=us_noaa_FL.tif "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
}
@@ -7550,7 +7559,8 @@ TEST(operation, compoundCRS_of_projCRS_to_geogCRS_2D_context) {
"+lat_1=41.6666666666667 +lat_2=40 +x_0=2000000.0001016 "
"+y_0=500000.0001016 +ellps=GRS80 "
"+step +proj=unitconvert +z_in=us-ft +z_out=m "
- "+step +proj=vgridshift +grids=geoid09_conus.gtx +multiplier=1 "
+ "+step +proj=vgridshift +grids=us_noaa_geoid09_conus.tif "
+ "+multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
}
@@ -8006,14 +8016,15 @@ TEST(operation, compoundCRS_of_vertCRS_with_geoid_model_to_geogCRS) {
"Ballpark geographic offset from NAD83(2011) to NAD83");
auto op_proj =
list[0]->exportToPROJString(PROJStringFormatter::create().get());
- EXPECT_EQ(op_proj,
- "+proj=pipeline "
- "+step +inv +proj=lcc +lat_0=39.3333333333333 +lon_0=-77.75 "
- "+lat_1=40.9666666666667 +lat_2=39.9333333333333 +x_0=600000 "
- "+y_0=0 +ellps=GRS80 "
- "+step +proj=vgridshift +grids=g2012bu0.gtx +multiplier=1 "
- "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
- "+step +proj=axisswap +order=2,1");
+ EXPECT_EQ(
+ op_proj,
+ "+proj=pipeline "
+ "+step +inv +proj=lcc +lat_0=39.3333333333333 +lon_0=-77.75 "
+ "+lat_1=40.9666666666667 +lat_2=39.9333333333333 +x_0=600000 "
+ "+y_0=0 +ellps=GRS80 "
+ "+step +proj=vgridshift +grids=us_noaa_g2012bu0.tif +multiplier=1 "
+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
+ "+step +proj=axisswap +order=2,1");
}
// ---------------------------------------------------------------------------
@@ -8069,8 +8080,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=hgridshift +grids=rdtrans2018.gsb "
- "+step +proj=vgridshift +grids=nlgeo2018.gtx +multiplier=1 "
+ "+step +proj=hgridshift +grids=nl_nsgi_rdtrans2018.tif "
+ "+step +proj=vgridshift +grids=nl_nsgi_nlgeo2018.tif +multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
}
@@ -8194,7 +8205,7 @@ TEST(operation, IGNF_LAMB1_TO_EPSG_4326) {
"+proj=pipeline +step +inv +proj=lcc +lat_1=49.5 +lat_0=49.5 "
"+lon_0=0 +k_0=0.99987734 +x_0=600000 +y_0=200000 "
"+ellps=clrk80ign +pm=paris +step +proj=hgridshift "
- "+grids=ntf_r93.gsb +step +proj=unitconvert +xy_in=rad "
+ "+grids=fr_ign_ntf_r93.tif +step +proj=unitconvert +xy_in=rad "
"+xy_out=deg +step +proj=axisswap +order=2,1");
EXPECT_FALSE(list[1]->hasBallparkTransformation());
@@ -9616,15 +9627,16 @@ TEST(operation, normalizeForVisualization) {
auto op = list[1];
auto opNormalized = op->normalizeForVisualization();
EXPECT_FALSE(opNormalized->_isEquivalentTo(op.get()));
- EXPECT_EQ(opNormalized->exportToPROJString(
- PROJStringFormatter::create(
- PROJStringFormatter::Convention::PROJ_5,
- authFactory->databaseContext())
- .get()),
- "+proj=pipeline "
- "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=egm08_25.gtx +multiplier=1 "
- "+step +proj=unitconvert +xy_in=rad +xy_out=deg");
+ EXPECT_EQ(
+ opNormalized->exportToPROJString(
+ PROJStringFormatter::create(
+ PROJStringFormatter::Convention::PROJ_5,
+ authFactory->databaseContext())
+ .get()),
+ "+proj=pipeline "
+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
+ "+step +proj=vgridshift +grids=us_nga_egm08_25.tif +multiplier=1 "
+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg");
}
// Source(boundCRS) and target(geographic) must be inverted