diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-12-04 18:29:35 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-12-04 18:29:35 +0100 |
| commit | ad42ef9e826a7864885c929632630b218796d9d3 (patch) | |
| tree | 952a665da6fceb7efb0a54efe1509683b5fc31a0 /test | |
| parent | ae2f7ad985e5da5d4f4006849b68fae7dde53375 (diff) | |
| download | PROJ-ad42ef9e826a7864885c929632630b218796d9d3.tar.gz PROJ-ad42ef9e826a7864885c929632630b218796d9d3.zip | |
WKT1 export of LOCAL_CS: add UNIT if explicitly set
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/test_crs.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index e0505fea..44b84401 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -4977,6 +4977,16 @@ TEST(crs, crs_alterCSLinearUnit) { } { + auto obj = WKTParser().createFromWKT("LOCAL_CS[\"foo\"]"); + auto crs = nn_dynamic_pointer_cast<EngineeringCRS>(obj); + auto alteredCRS = crs->alterCSLinearUnit(UnitOfMeasure("my unit", 2)); + auto wkt = alteredCRS->exportToWKT( + &(WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL) + ->setMultiLine(false))); + EXPECT_EQ(wkt, "LOCAL_CS[\"foo\",UNIT[\"my unit\",2]]"); + } + + { // Not implemented on compoundCRS auto crs = createCompoundCRS()->alterCSLinearUnit(UnitOfMeasure("my unit", 2)); |
