aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNyall Dawson <nyall.dawson@gmail.com>2020-02-24 08:40:43 +1000
committerEven Rouault <even.rouault@spatialys.com>2020-02-24 12:43:00 +0100
commit004116f53a9f2e2afde9ffcfdadcbe1d1f4df2ac (patch)
tree899c600d4526e4c43a5a7a62cbb9960f9d0aff50
parent25f8c03774bd639af9e07f616211caada9d307f0 (diff)
downloadPROJ-004116f53a9f2e2afde9ffcfdadcbe1d1f4df2ac.tar.gz
PROJ-004116f53a9f2e2afde9ffcfdadcbe1d1f4df2ac.zip
Fix mapping of Vertical_Near_Side_Perspective (fixes #1965)
-rw-r--r--include/proj/internal/coordinateoperation_constants.hpp5
-rw-r--r--include/proj/internal/esri_projection_mappings.hpp15
-rw-r--r--scripts/build_esri_projection_mapping.py9
-rw-r--r--src/proj_constants.h2
-rw-r--r--test/unit/test_io.cpp15
5 files changed, 30 insertions, 16 deletions
diff --git a/include/proj/internal/coordinateoperation_constants.hpp b/include/proj/internal/coordinateoperation_constants.hpp
index bc8f1208..00434418 100644
--- a/include/proj/internal/coordinateoperation_constants.hpp
+++ b/include/proj/internal/coordinateoperation_constants.hpp
@@ -513,7 +513,7 @@ static const ParamMapping paramViewpointHeight = {
static const ParamMapping *const paramsVerticalPerspective[] = {
&paramLatTopoOrigin,
&paramLonTopoOrigin,
- &paramHeightTopoOrigin,
+ &paramHeightTopoOrigin, // unsupported by PROJ right now
&paramViewpointHeight,
&paramFalseEasting, // PROJ addition
&paramFalseNorthing, // PROJ addition
@@ -747,9 +747,6 @@ static const MethodMapping projectionMethodMappings[] = {
{PROJ_WKT2_NAME_METHOD_VAN_DER_GRINTEN, 0, "VanDerGrinten", "vandg", "R_A",
paramsLonNatOrigin},
- {PROJ_WKT2_NAME_METHOD_VERTICAL_NEAR_SIDE_PERSPECTIVE, 0,
- "Vertical_Near_Side_Perspective", "nsper", nullptr, paramsLonNatOrigin},
-
{PROJ_WKT2_NAME_METHOD_WAGNER_I, 0, "Wagner_I", "wag1", nullptr,
paramsLonNatOrigin},
diff --git a/include/proj/internal/esri_projection_mappings.hpp b/include/proj/internal/esri_projection_mappings.hpp
index b916e0c2..707f9c47 100644
--- a/include/proj/internal/esri_projection_mappings.hpp
+++ b/include/proj/internal/esri_projection_mappings.hpp
@@ -630,8 +630,12 @@ static const ESRIParamMapping paramsESRI_Vertical_Near_Side_Perspective[] = {
EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0},
{"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING,
EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0},
- {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN,
- EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0},
+ {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_TOPOGRAPHIC_ORIGIN,
+ EPSG_CODE_PARAMETER_LONGITUDE_TOPOGRAPHIC_ORIGIN, 0.0},
+ {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_TOPOGRAPHIC_ORIGIN,
+ EPSG_CODE_PARAMETER_LATITUDE_TOPOGRAPHIC_ORIGIN, 0.0},
+ {"Height", EPSG_NAME_PARAMETER_VIEWPOINT_HEIGHT,
+ EPSG_CODE_PARAMETER_VIEWPOINT_HEIGHT, 0.0},
{nullptr, nullptr, 0, 0.0}};
static const ESRIParamMapping paramsESRI_Stereographic_North_Pole[] = {
@@ -924,8 +928,8 @@ static const ESRIMethodMapping esriMappings[] = {
{"Craster_Parabolic", "Craster Parabolic", 0, paramsESRI_Craster_Parabolic},
{"Gnomonic", PROJ_WKT2_NAME_METHOD_GNOMONIC, 0, paramsESRI_Gnomonic},
{"Times", PROJ_WKT2_NAME_METHOD_TIMES, 0, paramsESRI_Times},
- {"Vertical_Near_Side_Perspective",
- PROJ_WKT2_NAME_METHOD_VERTICAL_NEAR_SIDE_PERSPECTIVE, 0,
+ {"Vertical_Near_Side_Perspective", EPSG_NAME_METHOD_VERTICAL_PERSPECTIVE,
+ EPSG_CODE_METHOD_VERTICAL_PERSPECTIVE,
paramsESRI_Vertical_Near_Side_Perspective},
{"Stereographic_North_Pole", EPSG_NAME_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B,
EPSG_CODE_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B,
@@ -972,8 +976,7 @@ static const ESRIMethodMapping esriMappings[] = {
// ---------------------------------------------------------------------------
-// end of anonymous namespace
-} // namespace
+} // namespace {
//! @endcond
diff --git a/scripts/build_esri_projection_mapping.py b/scripts/build_esri_projection_mapping.py
index 8d16ca24..84eba426 100644
--- a/scripts/build_esri_projection_mapping.py
+++ b/scripts/build_esri_projection_mapping.py
@@ -467,11 +467,13 @@ config_str = """
- Central_Meridian: EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN
- Vertical_Near_Side_Perspective:
- WKT2_name: PROJ_WKT2_NAME_METHOD_VERTICAL_NEAR_SIDE_PERSPECTIVE
+ WKT2_name: EPSG_NAME_METHOD_VERTICAL_PERSPECTIVE
Params:
- False_Easting: EPSG_NAME_PARAMETER_FALSE_EASTING
- False_Northing: EPSG_NAME_PARAMETER_FALSE_NORTHING
- - Central_Meridian: EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN
+ - Longitude_Of_Center: EPSG_NAME_PARAMETER_LONGITUDE_TOPOGRAPHIC_ORIGIN
+ - Latitude_Of_Center: EPSG_NAME_PARAMETER_LATITUDE_TOPOGRAPHIC_ORIGIN
+ - Height: EPSG_NAME_PARAMETER_VIEWPOINT_HEIGHT
- Stereographic_North_Pole:
WKT2_name: EPSG_NAME_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B
@@ -787,8 +789,7 @@ print('};')
print("""
// ---------------------------------------------------------------------------
-// end of anonymous namespace
-}
+} // namespace {
//! @endcond
diff --git a/src/proj_constants.h b/src/proj_constants.h
index a70d5346..5b95cda6 100644
--- a/src/proj_constants.h
+++ b/src/proj_constants.h
@@ -201,8 +201,6 @@
#define PROJ_WKT2_NAME_METHOD_VAN_DER_GRINTEN "Van Der Grinten"
-#define PROJ_WKT2_NAME_METHOD_VERTICAL_NEAR_SIDE_PERSPECTIVE "Vertical Near Side Perspective"
-
#define PROJ_WKT2_NAME_METHOD_WAGNER_I "Wagner I"
#define PROJ_WKT2_NAME_METHOD_WAGNER_II "Wagner II"
#define PROJ_WKT2_NAME_METHOD_WAGNER_III "Wagner III"
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp
index cc780be1..95153a8a 100644
--- a/test/unit/test_io.cpp
+++ b/test/unit/test_io.cpp
@@ -5011,6 +5011,21 @@ static const struct {
{"False northing", 2},
}},
+ {"Vertical_Near_Side_Perspective",
+ {{"False_Easting", 1},
+ {"False_Northing", 2},
+ {"Longitude_Of_Center", 3},
+ {"Latitude_Of_Center", 4},
+ {"Height", 5}},
+ "Vertical Perspective",
+ {
+ {"Latitude of topocentric origin", 4},
+ {"Longitude of topocentric origin", 3},
+ {"Viewpoint height", 5},
+ {"False easting", 1},
+ {"False northing", 2},
+ }},
+
{
"Unknown_Method",
{{"False_Easting", 1},