aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operation.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-11-18 19:43:24 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-11-18 19:43:24 +0100
commit70aae0fe4262686d61289c3b710a4877c43e6c13 (patch)
tree494e74785876827c41c5872997509c338db2e8c6 /test/unit/test_operation.cpp
parent7553b219dce6a7d2a0381abfef171b5b4f15c29e (diff)
downloadPROJ-70aae0fe4262686d61289c3b710a4877c43e6c13.tar.gz
PROJ-70aae0fe4262686d61289c3b710a4877c43e6c13.zip
createOperations(): geocentric to geocentric operation synthetization: distinguish null transform from ballpark transform
Diffstat (limited to 'test/unit/test_operation.cpp')
-rw-r--r--test/unit/test_operation.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index ce01f967..73f5dbdc 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -592,9 +592,7 @@ static GeodeticCRSNNPtr createGeocentricDatumWGS84() {
static GeodeticCRSNNPtr createGeocentricKM() {
PropertyMap propertiesCRS;
- propertiesCRS.set(Identifier::CODESPACE_KEY, "EPSG")
- .set(Identifier::CODE_KEY, 4328)
- .set(IdentifiedObject::NAME_KEY, "WGS 84");
+ propertiesCRS.set(IdentifiedObject::NAME_KEY, "Based on WGS 84");
return GeodeticCRS::create(
propertiesCRS, GeodeticReferenceFrame::EPSG_6326,
CartesianCS::createGeocentric(
@@ -5077,13 +5075,13 @@ TEST(operation, geogCRS_to_geocentricCRS_different_datum) {
// ---------------------------------------------------------------------------
-TEST(operation, geocentricCRS_to_geocentricCRS_noop) {
+TEST(operation, geocentricCRS_to_geocentricCRS_same_noop) {
auto op = CoordinateOperationFactory::create()->createOperation(
createGeocentricDatumWGS84(), createGeocentricDatumWGS84());
ASSERT_TRUE(op != nullptr);
EXPECT_EQ(op->nameStr(),
- "Ballpark geocentric translation from WGS 84 to WGS 84");
+ "Null geocentric translation from WGS 84 to WGS 84");
EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=noop");
EXPECT_EQ(op->inverse()->nameStr(), op->nameStr());
@@ -5091,6 +5089,28 @@ TEST(operation, geocentricCRS_to_geocentricCRS_noop) {
// ---------------------------------------------------------------------------
+TEST(operation, geocentricCRS_to_geocentricCRS_different_ballpark) {
+
+ PropertyMap propertiesCRS;
+ propertiesCRS.set(Identifier::CODESPACE_KEY, "EPSG")
+ .set(Identifier::CODE_KEY, 4328)
+ .set(IdentifiedObject::NAME_KEY, "unknown");
+ auto otherGeocentricCRS = GeodeticCRS::create(
+ propertiesCRS, GeodeticReferenceFrame::EPSG_6269,
+ CartesianCS::createGeocentric(UnitOfMeasure::METRE));
+
+ auto op = CoordinateOperationFactory::create()->createOperation(
+ createGeocentricKM(), otherGeocentricCRS);
+ ASSERT_TRUE(op != nullptr);
+ EXPECT_EQ(
+ op->nameStr(),
+ "Ballpark geocentric translation from Based on WGS 84 to unknown");
+ EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=unitconvert +xy_in=km +z_in=km +xy_out=m +z_out=m");
+}
+
+// ---------------------------------------------------------------------------
+
TEST(operation, geocentricCRS_to_geogCRS_same_datum_context) {
auto authFactory =
AuthorityFactory::create(DatabaseContext::create(), "EPSG");