diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2022-01-21 00:42:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-21 00:42:07 +0100 |
| commit | 93c3a165126ac4c7caf4d2ffa2f7dd71633e7be3 (patch) | |
| tree | b1e14ff76968dd3cf5a6ff9dcb9cffa81e75c9ee /test/unit/test_factory.cpp | |
| parent | 66657fbadad85d81f4fe6e1918338c0a7f03def4 (diff) | |
| parent | 6dca8bdc057a454b599438c6caf92825880f3a87 (diff) | |
| download | PROJ-93c3a165126ac4c7caf4d2ffa2f7dd71633e7be3.tar.gz PROJ-93c3a165126ac4c7caf4d2ffa2f7dd71633e7be3.zip | |
Merge pull request #3025 from rouault/fix_qgis_45470
lookForGridInfo(): make it work properly when passed the old PROJ name
Diffstat (limited to 'test/unit/test_factory.cpp')
| -rw-r--r-- | test/unit/test_factory.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 9abade09..63931a5d 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -2763,6 +2763,47 @@ TEST_F(FactoryWithTmpDatabase, lookForGridInfo) { // --------------------------------------------------------------------------- +TEST_F(FactoryWithTmpDatabase, + lookForGridInfo_from_old_name_with_new_grid_available) { + createStructure(); + + ASSERT_TRUE(execute("INSERT INTO grid_alternatives(original_grid_name," + "proj_grid_name, " + "old_proj_grid_name, " + "proj_grid_format, " + "proj_method, " + "inverse_direction, " + "package_name, " + "url, direct_download, open_license, directory) " + "VALUES (" + "'NOT-YET-IN-GRID-TRANSFORMATION-original_grid_name', " + "'tests/egm96_15_uncompressed_truncated.tif', " + "'old_name.gtx', " + "'NTv2', " + "'hgridshift', " + "0, " + "NULL, " + "'url', 1, 1, NULL);")) + << last_error(); + + std::string fullFilename; + std::string packageName; + std::string url; + bool directDownload = false; + bool openLicense = false; + bool gridAvailable = false; + EXPECT_TRUE(DatabaseContext::create(m_ctxt)->lookForGridInfo( + "old_name.gtx", false, fullFilename, packageName, url, directDownload, + openLicense, gridAvailable)); + EXPECT_TRUE( + fullFilename.find("tests/egm96_15_uncompressed_truncated.tif") != + std::string::npos) + << fullFilename; + EXPECT_EQ(gridAvailable, true); +} + +// --------------------------------------------------------------------------- + TEST_F(FactoryWithTmpDatabase, custom_geodetic_crs) { createStructure(); populateWithFakeEPSG(); |
