@@ -3765,6 +3765,51 @@ TEST(crs, projectedCRS_identify_db) {
37653765 EXPECT_EQ (*(res.front ().first ->identifiers ()[0 ]->codeSpace ()), " EPSG" );
37663766 EXPECT_EQ (res.front ().second , 100 );
37673767 }
3768+ {
3769+ // The ellipsoid definition uses a unusual value for the inverse
3770+ // flattening Check that we only identify CRS whose ellipsoid shape is
3771+ // close to the input one (in particular no IAU_2015...)
3772+ auto obj = WKTParser ().attachDatabaseContext (dbContext).createFromWKT (
3773+ " PROJCRS[\" Transverse Mercator\" ,\n "
3774+ " BASEGEOGCRS[\" DE_DHDN (whole country, 2001) to ETRS89\" ,\n "
3775+ " DATUM[\" DE_DHDN (whole country, 2001) to ETRS89\" ,\n "
3776+ " ELLIPSOID[\" Bessel\" ,6377397.155,299.15281310608,\n "
3777+ " LENGTHUNIT[\" metre\" ,1,\n "
3778+ " ID[\" EPSG\" ,9001]]]],\n "
3779+ " PRIMEM[\" Greenwich\" ,0,\n "
3780+ " ANGLEUNIT[\" degree\" ,0.0174532925199433,\n "
3781+ " ID[\" EPSG\" ,9122]]]],\n "
3782+ " CONVERSION[\" Transverse Mercator\" ,\n "
3783+ " METHOD[\" Transverse Mercator\" ,\n "
3784+ " ID[\" EPSG\" ,9807]],\n "
3785+ " PARAMETER[\" Latitude of natural origin\" ,0,\n "
3786+ " ANGLEUNIT[\" degree\" ,0.0174532925199433],\n "
3787+ " ID[\" EPSG\" ,8801]],\n "
3788+ " PARAMETER[\" Longitude of natural origin\" ,12,\n "
3789+ " ANGLEUNIT[\" degree\" ,0.0174532925199433],\n "
3790+ " ID[\" EPSG\" ,8802]],\n "
3791+ " PARAMETER[\" Scale factor at natural origin\" ,1,\n "
3792+ " SCALEUNIT[\" unity\" ,1],\n "
3793+ " ID[\" EPSG\" ,8805]],\n "
3794+ " PARAMETER[\" False easting\" ,4500000,\n "
3795+ " LENGTHUNIT[\" metre\" ,1],\n "
3796+ " ID[\" EPSG\" ,8806]],\n "
3797+ " PARAMETER[\" False northing\" ,0,\n "
3798+ " LENGTHUNIT[\" metre\" ,1],\n "
3799+ " ID[\" EPSG\" ,8807]]],\n "
3800+ " CS[Cartesian,2],\n "
3801+ " AXIS[\" easting\" ,east,\n "
3802+ " ORDER[1],\n "
3803+ " LENGTHUNIT[\" meters\" ,1]],\n "
3804+ " AXIS[\" northing\" ,north,\n "
3805+ " ORDER[2],\n "
3806+ " LENGTHUNIT[\" meters\" ,1]]]" );
3807+ auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
3808+ ASSERT_TRUE (crs != nullptr );
3809+ auto factoryAll = AuthorityFactory::create (dbContext, std::string ());
3810+ auto res = crs->identify (factoryAll);
3811+ EXPECT_EQ (res.size (), 13U );
3812+ }
37683813}
37693814
37703815// ---------------------------------------------------------------------------
0 commit comments