aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-09-30 13:37:40 +0200
committerGitHub <noreply@github.com>2020-09-30 13:37:40 +0200
commit1cd25bb01d7a703b9556abdf57035ee0424faa26 (patch)
tree0b34f0a8f5517708baa0107d8210c77c00dfecc8 /test/unit
parent48c3a9a225b197d2462c4c03b18088fcc4f68c62 (diff)
parent016e8e60747a2def2dfd7ffc7f6ad2e6aa8ba009 (diff)
downloadPROJ-1cd25bb01d7a703b9556abdf57035ee0424faa26.tar.gz
PROJ-1cd25bb01d7a703b9556abdf57035ee0424faa26.zip
Merge pull request #2361 from rouault/ortho_ellipsoidal
Implement ellipsoidal formulation of +proj=ortho (fixes #397)
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_io.cpp68
1 files changed, 67 insertions, 1 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp
index f2464e5c..34396fcf 100644
--- a/test/unit/test_io.cpp
+++ b/test/unit/test_io.cpp
@@ -5225,6 +5225,21 @@ static const struct {
{"False_Northing", 2},
{"Longitude_Of_Center", 3},
{"Latitude_Of_Center", 4}},
+ "Orthographic (Spherical)",
+ {
+ {"Latitude of natural origin", 4},
+ {"Longitude of natural origin", 3},
+ {"False easting", 1},
+ {"False northing", 2},
+ }},
+
+ {"Local",
+ {{"False_Easting", 1},
+ {"False_Northing", 2},
+ {"Scale_Factor", 1},
+ {"Azimuth", 0},
+ {"Longitude_Of_Center", 3},
+ {"Latitude_Of_Center", 4}},
"Orthographic",
{
{"Latitude of natural origin", 4},
@@ -5233,6 +5248,24 @@ static const struct {
{"False northing", 2},
}},
+ // Local with unsupported value for Azimuth
+ {"Local",
+ {{"False_Easting", 1},
+ {"False_Northing", 2},
+ {"Scale_Factor", 1},
+ {"Azimuth", 123},
+ {"Longitude_Of_Center", 3},
+ {"Latitude_Of_Center", 4}},
+ "Local",
+ {
+ {"False_Easting", 1},
+ {"False_Northing", 2},
+ {"Scale_Factor", 1},
+ {"Azimuth", 123},
+ {"Longitude_Of_Center", 3},
+ {"Latitude_Of_Center", 4},
+ }},
+
{"Winkel_Tripel",
{{"False_Easting", 1},
{"False_Northing", 2},
@@ -5543,7 +5576,6 @@ static const struct {
{"Longitude_Of_Origin", 3},
{"Latitude_Of_Origin", 4}},
},
-
};
TEST(wkt_parse, esri_projcs) {
@@ -9201,6 +9233,40 @@ TEST(io, projparse_non_earth_ellipsoid) {
// ---------------------------------------------------------------------------
+TEST(io, projparse_ortho_ellipsoidal) {
+ std::string input("+proj=ortho +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 "
+ "+ellps=WGS84 +units=m +no_defs +type=crs");
+ auto obj = PROJStringParser().createFromPROJString(input);
+ auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
+ ASSERT_TRUE(crs != nullptr);
+ EXPECT_EQ(crs->derivingConversion()->method()->getEPSGCode(),
+ EPSG_CODE_METHOD_ORTHOGRAPHIC);
+ EXPECT_EQ(
+ crs->exportToPROJString(
+ PROJStringFormatter::create(PROJStringFormatter::Convention::PROJ_4)
+ .get()),
+ input);
+}
+
+// ---------------------------------------------------------------------------
+
+TEST(io, projparse_ortho_spherical) {
+ std::string input("+proj=ortho +f=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 "
+ "+ellps=WGS84 +units=m +no_defs +type=crs");
+ auto obj = PROJStringParser().createFromPROJString(input);
+ auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
+ ASSERT_TRUE(crs != nullptr);
+ EXPECT_EQ(crs->derivingConversion()->method()->nameStr(),
+ PROJ_WKT2_NAME_ORTHOGRAPHIC_SPHERICAL);
+ EXPECT_EQ(
+ crs->exportToPROJString(
+ PROJStringFormatter::create(PROJStringFormatter::Convention::PROJ_4)
+ .get()),
+ input);
+}
+
+// ---------------------------------------------------------------------------
+
TEST(io, projparse_axisswap_unitconvert_longlat_proj) {
std::string input =
"+type=crs +proj=pipeline +step +proj=axisswap +order=2,1 +step "