diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-11-26 15:47:57 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-11-29 00:35:25 +0100 |
| commit | 67758b2c67ea329116b59818c038797667c4e1d1 (patch) | |
| tree | 7e6b4ead6cbe9251ea5ef64d6c45179287597b2e /test | |
| parent | 7e05bd0ff52fe3ba78dfd75f9ebebe3dfe715bca (diff) | |
| download | PROJ-67758b2c67ea329116b59818c038797667c4e1d1.tar.gz PROJ-67758b2c67ea329116b59818c038797667c4e1d1.zip | |
Redirect epsg:XXXX and IGNF:XXXX CRS expansions to the database, and remove the data/epsg and data/IGNF files
Diffstat (limited to 'test')
| -rw-r--r-- | test/gie/4D-API_cs2cs-style.gie | 2 | ||||
| -rw-r--r-- | test/gie/more_builtins.gie | 1 | ||||
| -rw-r--r-- | test/gigs/5101.1-jhs.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5101.2-jhs.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5101.3-jhs.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5101.4-jhs-etmerc.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5102.1.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5103.1.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5103.2.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5103.3.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5105.2.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5106.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5107.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5109.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5111.1.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5112.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5113.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5201.gie | 2 | ||||
| -rw-r--r-- | test/gigs/5208.gie | 2 | ||||
| -rw-r--r-- | test/gigs/Makefile.am | 2 | ||||
| -rw-r--r-- | test/unit/test_c_api.cpp | 7 | ||||
| -rw-r--r-- | test/unit/test_factory.cpp | 10 | ||||
| -rw-r--r-- | test/unit/test_io.cpp | 16 |
23 files changed, 63 insertions, 9 deletions
diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie index 346f2d36..e653454e 100644 --- a/test/gie/4D-API_cs2cs-style.gie +++ b/test/gie/4D-API_cs2cs-style.gie @@ -207,6 +207,7 @@ expect failure ------------------------------------------------------------------------------- Test that Google's Web Mercator works as intended (see #834 for details). ------------------------------------------------------------------------------- +use_proj4_init_rules true operation proj=pipeline step init=epsg:26915 inv step init=epsg:3857 ------------------------------------------------------------------------------- tolerance 20 cm @@ -220,6 +221,7 @@ expect -10370728.80 5552839.74 0 ------------------------------------------------------------------------------- Test Google's Web Mercator with +proj=webmerc ------------------------------------------------------------------------------- +use_proj4_init_rules true operation proj=pipeline step init=epsg:26915 inv step proj=webmerc datum=WGS84 ------------------------------------------------------------------------------- tolerance 20 cm diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index 00c9d4a0..63464998 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -166,6 +166,7 @@ expect 12 55 0 0 ------------------------------------------------------------------------------- Finally test a pipeline with more than one init step ------------------------------------------------------------------------------- +use_proj4_init_rules true operation proj=pipeline step init=epsg:25832 inv step init=epsg:25833 diff --git a/test/gigs/5101.1-jhs.gie b/test/gigs/5101.1-jhs.gie index 2fd98883..efef9fcf 100644 --- a/test/gigs/5101.1-jhs.gie +++ b/test/gigs/5101.1-jhs.gie @@ -6,6 +6,8 @@ Test 5101 (part 1), Transverse Mercator, v2-0_2011-06-28, recommended JHS formul <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4326 +inv diff --git a/test/gigs/5101.2-jhs.gie b/test/gigs/5101.2-jhs.gie index 7ea6275e..3f6218ba 100644 --- a/test/gigs/5101.2-jhs.gie +++ b/test/gigs/5101.2-jhs.gie @@ -6,6 +6,8 @@ Test 5101 (part 2), Transverse Mercator, v2-0_2011-06-28, recommended JHS formul <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4326 +inv diff --git a/test/gigs/5101.3-jhs.gie b/test/gigs/5101.3-jhs.gie index d588df4c..05b902be 100644 --- a/test/gigs/5101.3-jhs.gie +++ b/test/gigs/5101.3-jhs.gie @@ -6,6 +6,8 @@ Test 5101 (part 3), Transverse Mercator, v2-0_2011-06-28, recommended JHS formul <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4283 +inv diff --git a/test/gigs/5101.4-jhs-etmerc.gie b/test/gigs/5101.4-jhs-etmerc.gie index b97b7769..42aad560 100644 --- a/test/gigs/5101.4-jhs-etmerc.gie +++ b/test/gigs/5101.4-jhs-etmerc.gie @@ -6,6 +6,8 @@ Test 5101 (part 4), Transverse Mercator, v2-0_2011-06-28, recommended JHS formul <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4190 +inv diff --git a/test/gigs/5102.1.gie b/test/gigs/5102.1.gie index d3eef080..33bf3bac 100644 --- a/test/gigs/5102.1.gie +++ b/test/gigs/5102.1.gie @@ -6,6 +6,8 @@ Test 5102, Lambert Conic Conformal (1SP), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4230 +inv diff --git a/test/gigs/5103.1.gie b/test/gigs/5103.1.gie index c972b738..73b7d0ca 100644 --- a/test/gigs/5103.1.gie +++ b/test/gigs/5103.1.gie @@ -6,6 +6,8 @@ Test 5103 (part 1), Lambert Conic Conformal (2SP), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4313 +inv diff --git a/test/gigs/5103.2.gie b/test/gigs/5103.2.gie index 3975e9d8..b32c2758 100644 --- a/test/gigs/5103.2.gie +++ b/test/gigs/5103.2.gie @@ -6,6 +6,8 @@ Test 5103 (part 2), Lambert Conic Conformal (2SP), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4152 +inv diff --git a/test/gigs/5103.3.gie b/test/gigs/5103.3.gie index b8965132..d486ec04 100644 --- a/test/gigs/5103.3.gie +++ b/test/gigs/5103.3.gie @@ -6,6 +6,8 @@ Test 5103 (part 3), Lambert Conic Conformal (2SP), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4152 +inv diff --git a/test/gigs/5105.2.gie b/test/gigs/5105.2.gie index 190c9176..daf86433 100644 --- a/test/gigs/5105.2.gie +++ b/test/gigs/5105.2.gie @@ -6,6 +6,8 @@ Test 5105 (part 2), Oblique Mercator (variant B), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4237 +inv diff --git a/test/gigs/5106.gie b/test/gigs/5106.gie index 6c5940ef..9082c0e7 100644 --- a/test/gigs/5106.gie +++ b/test/gigs/5106.gie @@ -6,6 +6,8 @@ Test 5106, Hotine Oblique Mercator (variant A), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4742 +inv diff --git a/test/gigs/5107.gie b/test/gigs/5107.gie index f78e9c22..bfd044fd 100644 --- a/test/gigs/5107.gie +++ b/test/gigs/5107.gie @@ -6,6 +6,8 @@ Test 5107, American Polyconic, v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4674 +inv diff --git a/test/gigs/5109.gie b/test/gigs/5109.gie index a104e66f..da42109a 100644 --- a/test/gigs/5109.gie +++ b/test/gigs/5109.gie @@ -6,6 +6,8 @@ Test 5109, Albers Equal Area, v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4283 +inv diff --git a/test/gigs/5111.1.gie b/test/gigs/5111.1.gie index d146b36a..fcbd4b1a 100644 --- a/test/gigs/5111.1.gie +++ b/test/gigs/5111.1.gie @@ -12,6 +12,8 @@ Test 5111 (part 1), Mercator (variant A), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline towgs84=0,0,0 +step +init=epsg:4211 +inv diff --git a/test/gigs/5112.gie b/test/gigs/5112.gie index 207632d2..ab5c0be8 100644 --- a/test/gigs/5112.gie +++ b/test/gigs/5112.gie @@ -6,6 +6,8 @@ Test 5112, Mercator (variant B), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation proj=pipeline step init=epsg:4284 inv diff --git a/test/gigs/5113.gie b/test/gigs/5113.gie index 5c3904e7..fdb4c381 100644 --- a/test/gigs/5113.gie +++ b/test/gigs/5113.gie @@ -6,6 +6,8 @@ Test 5113, Transverse Mercator (South Oriented), v2-0_2011-06-28. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4148 +inv diff --git a/test/gigs/5201.gie b/test/gigs/5201.gie index 532443a9..29805b79 100644 --- a/test/gigs/5201.gie +++ b/test/gigs/5201.gie @@ -12,6 +12,8 @@ Test 5201, Geographic Geocentric conversions, v2.0_2011-09-28. (EPSG 4979 - WGS8 <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4978 +inv diff --git a/test/gigs/5208.gie b/test/gigs/5208.gie index 25a10b96..985dfdcb 100644 --- a/test/gigs/5208.gie +++ b/test/gigs/5208.gie @@ -22,6 +22,8 @@ To be on the safe side we, use 0.01 m as the tolerance. <gie> +use_proj4_init_rules true + -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4275 +inv diff --git a/test/gigs/Makefile.am b/test/gigs/Makefile.am index f53825bd..bea3be59 100644 --- a/test/gigs/Makefile.am +++ b/test/gigs/Makefile.am @@ -20,7 +20,7 @@ EXTRA_DIST = \ 5201.gie \ 5208.gie -PROJ_LIB ?= $(top_srcdir)/data +PROJ_LIB ?= ../../data 5101.1: 5101.1-jhs.gie PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 6c22cade..d23920f5 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -2036,4 +2036,11 @@ TEST_F(CApi, proj_obj_cs_get_axis_info) { } } +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_context_get_database_metadata) { + EXPECT_TRUE(proj_context_get_database_metadata(m_ctxt, "IGNF.VERSION") != + nullptr); +} + } // namespace diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 739bb729..20869d91 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -2729,4 +2729,14 @@ TEST(factory, createObjectsFromName) { factory->createObjectsFromName("i_dont_exist", types, false, 1); } +// --------------------------------------------------------------------------- + +TEST(factory, getMetadata) { + auto ctxt = DatabaseContext::create(); + EXPECT_EQ(ctxt->getMetadata("i_do_not_exist"), nullptr); + const char *IGNF_VERSION = ctxt->getMetadata("IGNF.VERSION"); + ASSERT_TRUE(IGNF_VERSION != nullptr); + EXPECT_EQ(std::string(IGNF_VERSION), "3.0.2"); +} + } // namespace diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index a4974234..a2a865ad 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -7465,6 +7465,7 @@ TEST(io, projparse_projected_title) { // --------------------------------------------------------------------------- TEST(io, projparse_init) { + auto dbContext = DatabaseContext::create(); // Not allowed in non-compatibillity mode EXPECT_THROW(PROJStringParser().createFromPROJString("init=epsg:4326"), @@ -7473,7 +7474,6 @@ TEST(io, projparse_init) { { // EPSG:4326 is normally latitude-longitude order with degree, // but in compatibillity mode it will be long-lat radian - auto dbContext = DatabaseContext::create(); auto obj = createFromUserInput("init=epsg:4326", dbContext, true); auto crs = nn_dynamic_pointer_cast<GeographicCRS>(obj); ASSERT_TRUE(crs != nullptr); @@ -7485,7 +7485,6 @@ TEST(io, projparse_init) { { // EPSG:3040 is normally northing-easting order, but in compatibillity // mode it will be easting-northing - auto dbContext = DatabaseContext::create(); auto obj = createFromUserInput("init=epsg:3040", dbContext, true); auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); ASSERT_TRUE(crs != nullptr); @@ -7506,8 +7505,8 @@ TEST(io, projparse_init) { } { - auto obj = PROJStringParser().createFromPROJString( - "title=mytitle init=epsg:4326 ellps=WGS84"); + auto obj = createFromUserInput( + "title=mytitle init=epsg:4326 ellps=WGS84", dbContext, true); auto co = nn_dynamic_pointer_cast<CoordinateOperation>(obj); ASSERT_TRUE(co != nullptr); EXPECT_EQ(co->nameStr(), "mytitle"); @@ -7516,8 +7515,9 @@ TEST(io, projparse_init) { } { - auto obj = PROJStringParser().createFromPROJString( - "proj=pipeline step init=epsg:4326 step proj=longlat"); + auto obj = createFromUserInput( + "proj=pipeline step init=epsg:4326 step proj=longlat", dbContext, + true); auto co = nn_dynamic_pointer_cast<CoordinateOperation>(obj); ASSERT_TRUE(co != nullptr); EXPECT_EQ(co->exportToPROJString(PROJStringFormatter::create().get()), @@ -7525,8 +7525,8 @@ TEST(io, projparse_init) { } { - auto obj = PROJStringParser().createFromPROJString( - "init=epsg:4326 proj=longlat ellps=GRS80"); + auto obj = createFromUserInput( + "init=epsg:4326 proj=longlat ellps=GRS80", dbContext, true); auto crs = nn_dynamic_pointer_cast<GeographicCRS>(obj); ASSERT_TRUE(crs != nullptr); EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()), |
