aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-12-20 10:40:44 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-12-20 10:40:44 +0100
commit5f36c9ebde150e7ece7d153bf1dc7bd213de6016 (patch)
tree9000fc068cfd53785a0ab9a19a0b7dbba67af19e
parent6c40887e4df041d6be40a54818d98000180e3b7a (diff)
downloadPROJ-5f36c9ebde150e7ece7d153bf1dc7bd213de6016.tar.gz
PROJ-5f36c9ebde150e7ece7d153bf1dc7bd213de6016.zip
test: transformation_NZLVD_to_PROJ_string: attach database context to get filename substitution
-rw-r--r--src/iso19111/coordinateoperation.cpp2
-rw-r--r--test/unit/test_operation.cpp10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index 28f8b41c..aaa0c413 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -8768,7 +8768,7 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames(
}
if (methodEPSGCode == EPSG_CODE_METHOD_VERTCON ||
- methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_NZLVD ) {
+ methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_NZLVD) {
auto fileParameter =
parameterValue(EPSG_NAME_PARAMETER_VERTICAL_OFFSET_FILE,
EPSG_CODE_PARAMETER_VERTICAL_OFFSET_FILE);
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 15724c48..8cd7407d 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -6540,10 +6540,14 @@ TEST(operation, transformation_VERTCON_to_PROJ_string) {
// ---------------------------------------------------------------------------
TEST(operation, transformation_NZLVD_to_PROJ_string) {
- auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+ auto dbContext = DatabaseContext::create();
+ auto factory = AuthorityFactory::create(dbContext, "EPSG");
auto op = factory->createCoordinateOperation("7860", false);
- EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()),
- "+proj=vgridshift +grids=auckland-1946-to-nzvd2016-conversion.csv +multiplier=1");
+ EXPECT_EQ(op->exportToPROJString(
+ PROJStringFormatter::create(
+ PROJStringFormatter::Convention::PROJ_5, dbContext)
+ .get()),
+ "+proj=vgridshift +grids=auckht1946-nzvd2016.gtx +multiplier=1");
}
// ---------------------------------------------------------------------------