aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2018-04-11 23:58:42 +0200
committerGitHub <noreply@github.com>2018-04-11 23:58:42 +0200
commit75f8841fcab60ee9c0c15e135ec3ebd10fc46d18 (patch)
treee8fb5199327097bc6280099a4983d78a82374a22
parentcb376cb8172896553d3d5b5d0995873264eaf64e (diff)
parent38443f7545dad1d849a889921976fa94e9b76264 (diff)
downloadPROJ-75f8841fcab60ee9c0c15e135ec3ebd10fc46d18.tar.gz
PROJ-75f8841fcab60ee9c0c15e135ec3ebd10fc46d18.zip
Merge pull request #929 from kbevers/nsper-updates
Nsper updates
-rw-r--r--docs/source/operations/projections/nsper.rst23
-rw-r--r--test/gie/builtins.gie54
2 files changed, 76 insertions, 1 deletions
diff --git a/docs/source/operations/projections/nsper.rst b/docs/source/operations/projections/nsper.rst
index 4a8651fc..3f46f2b4 100644
--- a/docs/source/operations/projections/nsper.rst
+++ b/docs/source/operations/projections/nsper.rst
@@ -4,7 +4,28 @@
Near-sided perspective
********************************************************************************
+The near-sided perspective projection simulates a view from a height
+:math:`h` similar to how a satellite in orbit would see it.
+
++---------------------+-------------------------------------------------------------+
+| **Classification** | Azimuthal. Neither conformal nor equal area. |
++---------------------+-------------------------------------------------------------+
+| **Available forms** | Forward and inverse spherical projection |
++---------------------+-------------------------------------------------------------+
+| **Defined area** | Global, although for one hemisphere at a time. |
++---------------------+-------------------------------------------------------------+
+| **Options** |
++---------------------+-------------------------------------------------------------+
+| `+h` | Height of the view point above the Earth and must be in |
+| | the same units as the radius of the sphere. Required. |
++---------------------+-------------------------------------------------------------|
+| `+lat_0` | Latitude (in degrees) of the view position. Defaults to 0. |
++---------------------+-------------------------------------------------------------+
+| `+lon_0` | Longitude (in degrees) of the view position. Defaults to 0. |
++---------------------+-------------------------------------------------------------+
+
+
.. image:: ./images/nsper.png
:scale: 50%
- :alt: Near-sided perspective
+ :alt: Near-sided perspective
diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie
index 4f6d6a44..fb8a53c3 100644
--- a/test/gie/builtins.gie
+++ b/test/gie/builtins.gie
@@ -3347,6 +3347,60 @@ expect -0.001790493 0.000895247
accept -200 -100
expect -0.001790493 -0.000895247
+-------------------------------------------------------------------------------
+Test north polar aspect
+-------------------------------------------------------------------------------
+operation +proj=nsper +R=1 +h=3 +lat_0=90
+-------------------------------------------------------------------------------
+tolerance 0.1 mm
+accept 0 90
+expect 0 0
+accept 45 45
+expect 0.4555 -0.4555
+roundtrip 100
+accept 0 0
+expect failure errno tolerance_condition
+
+direction inverse
+accept 0 0
+expect 0 90
+accept 0 2 # projected coordinate is outside the sphere
+expect failure errno tolerance_condition
+
+-------------------------------------------------------------------------------
+Test south polar aspect
+-------------------------------------------------------------------------------
+operation +proj=nsper +R=1 +h=3 +lat_0=-90
+-------------------------------------------------------------------------------
+tolerance 0.1 mm
+accept 0 -90
+expect 0 0
+accept -45 -45
+expect -0.4555 0.4555
+roundtrip 100
+accept 0 0
+expect failure errno tolerance_condition
+
+-------------------------------------------------------------------------------
+operation +proj=nsper +R=1 +h=3 +lat_0=45
+-------------------------------------------------------------------------------
+tolerance 0.1 mm
+accept 0 45
+expect 0 0
+accept 0 90
+expect 0 0.6442
+accept 0 0
+expect 0 -0.6442
+accept 45 45
+expect 0.4767 0.1396
+roundtrip 100
+
+
+-------------------------------------------------------------------------------
+operation +proj=nsper +R=1 +h=0
+-------------------------------------------------------------------------------
+expect failure errno h_less_than_zero
+
===============================================================================
New Zealand Map Grid