diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-01-08 16:22:15 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-01-08 21:25:07 +0100 |
| commit | f5e5435fd5071d550e0d13f7a5d71e09c1fab2c0 (patch) | |
| tree | f569d5270f7cb34adf056d04c84a23db6b4f6ed0 /test/unit/test_factory.cpp | |
| parent | fdee4277efb45b07db2dcc4d93376cbd01cfbd0a (diff) | |
| download | PROJ-f5e5435fd5071d550e0d13f7a5d71e09c1fab2c0.tar.gz PROJ-f5e5435fd5071d550e0d13f7a5d71e09c1fab2c0.zip | |
ISO19111: remove PROJ.5 specific format for CRS (refs #1214)
As discussed in https://github.com/OSGeo/proj.4/issues/1214#issuecomment-452084720,
the introduction of a new PROJ.5 format to export CRS using pipeline/unitconvert/axisswap
as an attempt of improving the PROJ.4 format used by GDAL and other products is
likely a dead-end since it is still lossy in many aspects and can cause confusion
with coodinate operations.
Consequently the PROJ_5 convention will be identical to PROJ_4 for CRS export.
Note: on the import side, I've kept the code that could parse unitconvert and
axisswap when building a CRS definition from a pipeline. It is there as a hidden
feature as it was kind of a tear to remove that code in case it might still be
useful...
Diffstat (limited to 'test/unit/test_factory.cpp')
| -rw-r--r-- | test/unit/test_factory.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index deff6b63..e9b29728 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -409,9 +409,7 @@ TEST(factory, AuthorityFactory_createGeodeticCRS_geographic2D) { EXPECT_TRUE(extent->isEquivalentTo(factory->createExtent("1262").get())); EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=pipeline +step +proj=longlat +ellps=WGS84 +step " - "+proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap " - "+order=2,1"); + "+proj=longlat +datum=WGS84 +no_defs"); } // --------------------------------------------------------------------------- @@ -972,11 +970,9 @@ TEST(factory, AuthorityFactory_test_uom_9110) { // This tests conversion from unit of measure EPSG:9110 DDD.MMSSsss auto crs = factory->createProjectedCRS("2172"); EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=pipeline +step +proj=axisswap +order=2,1 +step " - "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=sterea " - "+lat_0=53.0019444444444 +lon_0=21.5027777777778 +k=0.9998 " - "+x_0=4603000 +y_0=5806000 +ellps=krass +step +proj=axisswap " - "+order=2,1"); + "+proj=sterea +lat_0=53.0019444444444 +lon_0=21.5027777777778 " + "+k=0.9998 +x_0=4603000 +y_0=5806000 +ellps=krass +units=m " + "+no_defs"); } // --------------------------------------------------------------------------- @@ -2327,10 +2323,8 @@ TEST_F(FactoryWithTmpDatabase, custom_projected_crs) { EXPECT_EQ(*(crs->name()->description()), "my name"); EXPECT_EQ(crs->identifiers().size(), 1); EXPECT_EQ(crs->derivingConversion()->targetCRS().get(), crs.get()); - EXPECT_EQ( - crs->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad " - "+step +proj=mbt_s +unused_flag +ellps=WGS84"); + EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=mbt_s +unused_flag +datum=WGS84 +units=m +no_defs"); EXPECT_TRUE(crs->canonicalBoundCRS() == nullptr); } { @@ -2338,10 +2332,8 @@ TEST_F(FactoryWithTmpDatabase, custom_projected_crs) { EXPECT_EQ(*(crs->name()->description()), "my name"); EXPECT_EQ(crs->identifiers().size(), 1); EXPECT_EQ(crs->derivingConversion()->targetCRS().get(), crs.get()); - EXPECT_EQ( - crs->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad " - "+step +proj=mbt_s +unused_flag +ellps=WGS84"); + EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=mbt_s +unused_flag +datum=WGS84 +units=m +no_defs"); EXPECT_TRUE(crs->canonicalBoundCRS() != nullptr); } |
