Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add square conformal projections from libproject #2148

Merged
merged 1 commit into from Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/plot/plot.py
Expand Up @@ -248,7 +248,11 @@ def plotproj(plotdef, data, outdir):
(plotdef['lonmax'], plotdef['latmax']),
(plotdef['lonmax'], plotdef['latmin']),
])
temp_pol = temp_pol.intersection(box)
try:
temp_pol = temp_pol.intersection(box)
except Exception as e:
continue


if plotdef['type'] == 'poly':
if isinstance(temp_pol, MultiPolygon):
Expand Down
58 changes: 58 additions & 0 deletions docs/plot/plotdefs.json
@@ -1,4 +1,40 @@
[
{
"filename": "adams_hemi.png",
"latmax": 90,
"latmin": -90,
"lonmax": 180,
"lonmin": -180,
"name": "adams_hemi",
"projstring": "+proj=adams_hemi",
"res": "low",
"type": "poly"

},
{
"filename": "adams_ws1.png",
"latmax": 90,
"latmin": -90,
"lonmax": 180,
"lonmin": -180,
"name": "adams_ws1",
"projstring": "+proj=adams_ws1",
"res": "low",
"type": "poly"

},
{
"filename": "adams_ws2.png",
"latmax": 90,
"latmin": -90,
"lonmax": 180,
"lonmin": -180,
"name": "adams_ws2",
"projstring": "+proj=adams_ws2",
"res": "low",
"type": "poly"

},
{
"filename": "aea.png",
"latmax": 90,
Expand Down Expand Up @@ -474,6 +510,17 @@
"res": "med",
"type": "poly"
},
{
"filename": "guyou.png",
"latmax": 90,
"latmin": -90,
"lonmax": 180,
"lonmin": -180,
"name": "guyou",
"projstring": "+proj=guyou",
"res": "low",
"type": "poly"
},
{
"filename": "hammer.png",
"latmax": 90,
Expand Down Expand Up @@ -992,6 +1039,17 @@
"res": "low",
"type": "poly"
},
{
"filename": "peirce_q.png",
"latmax": 90,
"latmin": -90,
"lonmax": 180,
"lonmin": -180,
"name": "peirce_q",
"projstring": "+proj=peirce_q",
"res": "low",
"type": "poly"
},
{
"filename": "poly.png",
"latmax": 90,
Expand Down
42 changes: 42 additions & 0 deletions docs/source/operations/projections/adams_hemi.rst
@@ -0,0 +1,42 @@
.. _adams_hemi:

********************************************************************************
Adams Hemisphere in a Square
********************************************************************************

+---------------------+----------------------------------------------------------+
| **Classification** | Miscellaneous |
+---------------------+----------------------------------------------------------+
| **Available forms** | Forward spherical projection |
+---------------------+----------------------------------------------------------+
| **Defined area** | Global |
+---------------------+----------------------------------------------------------+
| **Alias** | adams_hemi |
+---------------------+----------------------------------------------------------+
| **Domain** | 2D |
+---------------------+----------------------------------------------------------+
| **Input type** | Geodetic coordinates |
+---------------------+----------------------------------------------------------+
| **Output type** | Projected coordinates |
+---------------------+----------------------------------------------------------+


.. figure:: ./images/adams_hemi.png
:width: 500 px
:align: center
:alt: Adams Hemisphere in a Square

proj-string: ``+proj=adams_hemi``

Parameters
################################################################################

.. note:: All parameters are optional.

.. include:: ../options/lon_0.rst

.. include:: ../options/R.rst

.. include:: ../options/x_0.rst

.. include:: ../options/y_0.rst
42 changes: 42 additions & 0 deletions docs/source/operations/projections/adams_ws1.rst
@@ -0,0 +1,42 @@
.. _adams_ws1:

********************************************************************************
Adams World in a Square I
********************************************************************************

+---------------------+----------------------------------------------------------+
| **Classification** | Miscellaneous |
+---------------------+----------------------------------------------------------+
| **Available forms** | Forward spherical projection |
+---------------------+----------------------------------------------------------+
| **Defined area** | Global |
+---------------------+----------------------------------------------------------+
| **Alias** | adams_ws1 |
+---------------------+----------------------------------------------------------+
| **Domain** | 2D |
+---------------------+----------------------------------------------------------+
| **Input type** | Geodetic coordinates |
+---------------------+----------------------------------------------------------+
| **Output type** | Projected coordinates |
+---------------------+----------------------------------------------------------+


.. figure:: ./images/adams_ws1.png
:width: 500 px
:align: center
:alt: Adams World in a Square I

proj-string: ``+proj=adams_ws1``

Parameters
################################################################################

.. note:: All parameters are optional.

.. include:: ../options/lon_0.rst

.. include:: ../options/R.rst

.. include:: ../options/x_0.rst

.. include:: ../options/y_0.rst
42 changes: 42 additions & 0 deletions docs/source/operations/projections/adams_ws2.rst
@@ -0,0 +1,42 @@
.. _adams_ws2:

********************************************************************************
Adams World in a Square II
********************************************************************************

+---------------------+----------------------------------------------------------+
| **Classification** | Miscellaneous |
+---------------------+----------------------------------------------------------+
| **Available forms** | Forward spherical projection |
+---------------------+----------------------------------------------------------+
| **Defined area** | Global |
+---------------------+----------------------------------------------------------+
| **Alias** | adams_ws2 |
+---------------------+----------------------------------------------------------+
| **Domain** | 2D |
+---------------------+----------------------------------------------------------+
| **Input type** | Geodetic coordinates |
+---------------------+----------------------------------------------------------+
| **Output type** | Projected coordinates |
+---------------------+----------------------------------------------------------+


.. figure:: ./images/adams_ws2.png
:width: 500 px
:align: center
:alt: Adams World in a Square II

proj-string: ``+proj=adams_ws2``

Parameters
################################################################################

.. note:: All parameters are optional.

.. include:: ../options/lon_0.rst

.. include:: ../options/R.rst

.. include:: ../options/x_0.rst

.. include:: ../options/y_0.rst
42 changes: 42 additions & 0 deletions docs/source/operations/projections/guyou.rst
@@ -0,0 +1,42 @@
.. _guyou:

********************************************************************************
Guyou
********************************************************************************

+---------------------+----------------------------------------------------------+
| **Classification** | Miscellaneous |
+---------------------+----------------------------------------------------------+
| **Available forms** | Forward spherical projection |
+---------------------+----------------------------------------------------------+
| **Defined area** | Global |
+---------------------+----------------------------------------------------------+
| **Alias** | guyou |
+---------------------+----------------------------------------------------------+
| **Domain** | 2D |
+---------------------+----------------------------------------------------------+
| **Input type** | Geodetic coordinates |
+---------------------+----------------------------------------------------------+
| **Output type** | Projected coordinates |
+---------------------+----------------------------------------------------------+


.. figure:: ./images/guyou.png
:width: 500 px
:align: center
:alt: Guyou

proj-string: ``+proj=guyou``

Parameters
################################################################################

.. note:: All parameters are optional.

.. include:: ../options/lon_0.rst

.. include:: ../options/R.rst

.. include:: ../options/x_0.rst

.. include:: ../options/y_0.rst
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/source/operations/projections/index.rst
Expand Up @@ -12,6 +12,9 @@ Projections map the spherical 3D space to a flat 2D space.
.. toctree::
:maxdepth: 1

adams_hemi
adams_ws1
adams_ws2
aea
aeqd
airy
Expand Down Expand Up @@ -55,6 +58,7 @@ Projections map the spherical 3D space to a flat 2D space.
goode
gs48
gs50
guyou
hammer
hatano
healpix
Expand Down Expand Up @@ -104,6 +108,7 @@ Projections map the spherical 3D space to a flat 2D space.
ortho
patterson
pconic
peirce_q
poly
putp1
putp2
Expand Down
42 changes: 42 additions & 0 deletions docs/source/operations/projections/peirce_q.rst
@@ -0,0 +1,42 @@
.. _peirce_q:

********************************************************************************
Peirce Quincuncial
********************************************************************************

+---------------------+----------------------------------------------------------+
| **Classification** | Miscellaneous |
+---------------------+----------------------------------------------------------+
| **Available forms** | Forward spherical projection |
+---------------------+----------------------------------------------------------+
| **Defined area** | Global |
+---------------------+----------------------------------------------------------+
| **Alias** | peirce_q |
+---------------------+----------------------------------------------------------+
| **Domain** | 2D |
+---------------------+----------------------------------------------------------+
| **Input type** | Geodetic coordinates |
+---------------------+----------------------------------------------------------+
| **Output type** | Projected coordinates |
+---------------------+----------------------------------------------------------+


.. figure:: ./images/peirce_q.png
:width: 500 px
:align: center
:alt: Peirce Quincuncial

proj-string: ``+proj=peirce_q``

Parameters
################################################################################

.. note:: All parameters are optional.

.. include:: ../options/lon_0.rst

.. include:: ../options/R.rst

.. include:: ../options/x_0.rst

.. include:: ../options/y_0.rst
1 change: 1 addition & 0 deletions src/Makefile.am
Expand Up @@ -72,6 +72,7 @@ libproj_la_SOURCES = \
iso19111/c_api.cpp \
\
projections/aeqd.cpp \
projections/adams.cpp \
projections/gnom.cpp \
projections/laea.cpp \
projections/mod_ster.cpp \
Expand Down
1 change: 1 addition & 0 deletions src/lib_proj.cmake
Expand Up @@ -56,6 +56,7 @@ print_variable(ENABLE_IPO)

set(SRC_LIBPROJ_PROJECTIONS
projections/aeqd.cpp
projections/adams.cpp
projections/gnom.cpp
projections/laea.cpp
projections/mod_ster.cpp
Expand Down
5 changes: 5 additions & 0 deletions src/pj_list.h
Expand Up @@ -5,6 +5,9 @@ static const char PJ_LIST_H_ID[] = "@(#)pj_list.h 4.5 95/08/09 GIE REL";
**
** Copy this file and retain only appropriate lines for subset list
*/
PROJ_HEAD(adams_hemi, "Adams Hemisphere in a Square")
PROJ_HEAD(adams_ws1, "Adams World in a Square I")
PROJ_HEAD(adams_ws2, "Adams World in a Square II")
PROJ_HEAD(aea, "Albers Equal Area")
PROJ_HEAD(aeqd, "Azimuthal Equidistant")
PROJ_HEAD(affine, "Affine transformation")
Expand Down Expand Up @@ -56,6 +59,7 @@ PROJ_HEAD(gnom, "Gnomonic")
PROJ_HEAD(goode, "Goode Homolosine")
PROJ_HEAD(gs48, "Mod. Stererographics of 48 U.S.")
PROJ_HEAD(gs50, "Mod. Stererographics of 50 U.S.")
PROJ_HEAD(guyou, "Guyou")
PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff")
PROJ_HEAD(hatano, "Hatano Asymmetrical Equal Area")
PROJ_HEAD(healpix, "HEALPix")
Expand Down Expand Up @@ -115,6 +119,7 @@ PROJ_HEAD(ortel, "Ortelius Oval")
PROJ_HEAD(ortho, "Orthographic")
PROJ_HEAD(pconic, "Perspective Conic")
PROJ_HEAD(patterson, "Patterson Cylindrical")
PROJ_HEAD(peirce_q, "Peirce Quincuncial")
PROJ_HEAD(pipeline, "Transformation pipeline manager")
PROJ_HEAD(poly, "Polyconic (American)")
PROJ_HEAD(pop, "Retrieve coordinate value from pipeline stack")
Expand Down