aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_crs.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-05-13 18:03:40 +0200
committerGitHub <noreply@github.com>2019-05-13 18:03:40 +0200
commitd67203a6f76a74f5ac029ff052dbcc72e3b59624 (patch)
treebc959ee31e7f73e9ccbd5004340b3ee0548df7e5 /test/unit/test_crs.cpp
parent32703ddba9081682b4c39ae7bcedeabeb8c6143d (diff)
parent97d6060e596d1b044f84e7d140b26200ef56f65e (diff)
downloadPROJ-d67203a6f76a74f5ac029ff052dbcc72e3b59624.tar.gz
PROJ-d67203a6f76a74f5ac029ff052dbcc72e3b59624.zip
Merge pull request #1466 from rouault/fix_identify_1465
identify(): take into account the authority passed in (fixes #1465)
Diffstat (limited to 'test/unit/test_crs.cpp')
-rw-r--r--test/unit/test_crs.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index fbbd4f64..0f0304b1 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -1984,13 +1984,35 @@ TEST(crs, projectedCRS_identify_no_db) {
TEST(crs, projectedCRS_identify_db) {
auto dbContext = DatabaseContext::create();
auto factoryEPSG = AuthorityFactory::create(dbContext, "EPSG");
+ auto factoryIGNF = AuthorityFactory::create(dbContext, "IGNF");
+ auto factoryAnonymous = AuthorityFactory::create(dbContext, std::string());
{
// Identify by existing code
- auto res =
- factoryEPSG->createProjectedCRS("2172")->identify(factoryEPSG);
- ASSERT_EQ(res.size(), 1U);
- EXPECT_EQ(res.front().first->getEPSGCode(), 2172);
- EXPECT_EQ(res.front().second, 100);
+ auto crs = factoryEPSG->createProjectedCRS("2172");
+ {
+ auto res = crs->identify(factoryEPSG);
+ ASSERT_EQ(res.size(), 1U);
+ EXPECT_EQ(res.front().first->getEPSGCode(), 2172);
+ EXPECT_EQ(res.front().second, 100);
+ }
+ {
+ auto res = crs->identify(factoryAnonymous);
+ ASSERT_EQ(res.size(), 1U);
+ }
+ {
+ auto res = crs->identify(factoryIGNF);
+ ASSERT_EQ(res.size(), 0U);
+ }
+ }
+ {
+ // Identify by existing code
+ auto crs = factoryIGNF->createProjectedCRS("ETRS89UTM28");
+ {
+ auto res = crs->identify(factoryEPSG);
+ ASSERT_EQ(res.size(), 1U);
+ EXPECT_EQ(res.front().first->getEPSGCode(), 25828);
+ EXPECT_EQ(res.front().second, 70);
+ }
}
{
// Non-existing code