aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorHoward Butler <howard@hobu.co>2020-10-14 14:40:42 -0500
committerGitHub <noreply@github.com>2020-10-14 14:40:42 -0500
commita762daddb54be6e697375f8ed347cdf0aeaf4477 (patch)
treeae7e720c8512c02490a10448f12f264cea49b678 /docs
parentbb7dde0752bfb35389b536b2ee6cd37f94f0a511 (diff)
downloadPROJ-a762daddb54be6e697375f8ed347cdf0aeaf4477.tar.gz
PROJ-a762daddb54be6e697375f8ed347cdf0aeaf4477.zip
Plot building Github Action (#2377)
* implement conda package building * paths * need libtool * PLATFORM check * point to my PROJ feedstock for now * point to PROJ repos * plot building and artifact upload * syntax * add proj conda package for plotting * retab * no doxygen * syntax * update docs Makefile * doc building * needs * consolidate doc/plots * plot updates * put updated plot output into docs * register spelling module * use v2 download-artifact * artifact upload
Diffstat (limited to 'docs')
-rw-r--r--docs/Makefile234
-rw-r--r--docs/plot/plot.py25
-rw-r--r--docs/source/conf.py1
-rw-r--r--docs/source/operations/projections/bertin1953.rst2
-rw-r--r--docs/source/operations/projections/cass.rst4
-rw-r--r--docs/source/operations/projections/ccon.rst18
-rw-r--r--docs/source/operations/projections/eqearth.rst4
-rw-r--r--docs/source/operations/projections/gall.rst4
-rw-r--r--docs/source/operations/projections/tmerc.rst4
-rw-r--r--docs/source/usage/transformation.rst8
10 files changed, 54 insertions, 250 deletions
diff --git a/docs/Makefile b/docs/Makefile
index a63498ab..b9fa8257 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -1,229 +1,21 @@
-# Makefile for Sphinx documentation
+# Minimal makefile for Sphinx documentation
#
-# You can set these variables from the command line.
-SPHINXOPTS = -W
-SPHINXBUILD = sphinx-build
-PAPER =
+# You can set these variables from the command line, and also
+# from the environment for the first two.
+SPHINXOPTS ?=
+SPHINXBUILD ?= sphinx-build
+SOURCEDIR = source
BUILDDIR = build
-# User-friendly check for sphinx-build
-ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
-$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
-endif
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
-
-.PHONY: help
+# Put it first so that "make" without argument is like "make help".
help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " applehelp to make an Apple Help Book"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " xml to make Docutils-native XML files"
- @echo " pseudoxml to make pseudoxml-XML files for display purposes"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
- @echo " coverage to run coverage check of the documentation (if enabled)"
-
-.PHONY: clean
-clean:
- rm -rf $(BUILDDIR)/*
- rm -rf .doxygen_up_to_date
-
-.doxygen_up_to_date: ../Doxyfile ../src/*.cpp ../include/proj/*.hpp
- ../scripts/doxygen.sh
- touch .doxygen_up_to_date
-
-.PHONY: html
-html: .doxygen_up_to_date
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- # Undoes the hack done in scripts/doxygen.sh
- @sed "s/io::Convention_/io::Convention/g" < $(BUILDDIR)/html/development/reference/cpp/io.html | sed "s/>Convention_/>Convention/g" | sed "s/_WKT2/WKT2/g" | sed "s/_WKT1/WKT1/g" > $(BUILDDIR)/html/development/reference/cpp/io.html.tmp
- @mv $(BUILDDIR)/html/development/reference/cpp/io.html.tmp $(BUILDDIR)/html/development/reference/cpp/io.html
- # Undoes the hacks of scripts/generate_breathe_friendly_general_doc.py
- @sed "s/<em class=\"property\">namespace <\/em>//g" < $(BUILDDIR)/html/development/reference/cpp/cpp_general.html > $(BUILDDIR)/html/development/reference/cpp/cpp_general.html.tmp
- @mv $(BUILDDIR)/html/development/reference/cpp/cpp_general.html.tmp $(BUILDDIR)/html/development/reference/cpp/cpp_general.html
- @cp -r ../schemas $(BUILDDIR)/html/schemas
- @cp ../data/triangulation.schema.json $(BUILDDIR)/html/schemas
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-.PHONY: dirhtml
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-.PHONY: singlehtml
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-.PHONY: pickle
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-.PHONY: json
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-.PHONY: htmlhelp
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-.PHONY: qthelp
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/proj.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/proj.qhc"
-
-.PHONY: applehelp
-applehelp:
- $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
- @echo
- @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
- @echo "N.B. You won't be able to view it unless you put it in" \
- "~/Library/Documentation/Help or install it in your application" \
- "bundle."
-
-.PHONY: devhelp
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/proj"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/proj"
- @echo "# devhelp"
-
-.PHONY: epub
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-.PHONY: latex
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-.PHONY: latexpdf
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-.PHONY: latexpdfja
-latexpdfja:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through platex and dvipdfmx..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-.PHONY: text
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-.PHONY: man
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-.PHONY: texinfo
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-.PHONY: info
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-.PHONY: gettext
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-.PHONY: changes
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-.PHONY: linkcheck
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-.PHONY: doctest
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-.PHONY: coverage
-coverage:
- $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
- @echo "Testing of coverage in the sources finished, look at the " \
- "results in $(BUILDDIR)/coverage/python.txt."
+.PHONY: help Makefile
-.PHONY: xml
-xml:
- $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
- @echo
- @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-.PHONY: pseudoxml
-pseudoxml:
- $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
- @echo
- @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff --git a/docs/plot/plot.py b/docs/plot/plot.py
index 1822f347..13ed332c 100644
--- a/docs/plot/plot.py
+++ b/docs/plot/plot.py
@@ -46,6 +46,7 @@ from __future__ import division
import os
import os.path
+import shutil
import sys
import json
import subprocess
@@ -61,8 +62,12 @@ from shapely.geometry import shape
from shapely.ops import transform
from descartes import PolygonPatch
-PROJ = os.environ.get('PROJ_EXE', '../../src/proj')
-PROJ_LIB = '../../data'
+PROJ_COMMAND = os.environ.get('PROJ_EXE', '../../src/proj')
+if not os.path.exists(PROJ_COMMAND):
+ PROJ = shutil.which(PROJ_COMMAND)
+else:
+ PROJ = PROJ_COMMAND
+PROJ_LIB = os.environ.get('PROJ_LIB', '../../data')
LINE_LOW = 'data/coastline.geojson'
LINE_MED = 'data/coastline50.geojson'
@@ -160,9 +165,9 @@ def project(coordinates, proj_string, in_radians=False):
try:
proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
env={'PROJ_LIB': os.path.abspath(PROJ_LIB)})
- except FileNotFoundError:
+ except FileNotFoundError as e:
print("'proj' binary not found, set the PROJ_EXE environment variable "
- "to point to your local 'proj' binary")
+ "to point to your local 'proj' binary --%s--" % e)
exit(1)
stdout, _ = proc.communicate(coordinates.tobytes(order='C'))
@@ -223,7 +228,10 @@ def resample_polygon(polygon):
'''
Use interp_coords() to resample (multi)polygons.
'''
- xy = polygon.exterior.coords.xy
+ try:
+ xy = polygon.exterior.coords.xy
+ except AttributeError: #no xy's
+ return polygon
ext = interp_coords(xy, 2)
# interiors
rings = []
@@ -267,8 +275,11 @@ def plotproj(plotdef, data, outdir):
proj_geom = transform(trans, pol)
if plotdef['type'] == 'poly':
- patch = PolygonPatch(proj_geom, fc=COLOR_LAND, zorder=0)
- axes.add_patch(patch)
+ try:
+ patch = PolygonPatch(proj_geom, fc=COLOR_LAND, zorder=0)
+ axes.add_patch(patch)
+ except TypeError:
+ pass
else:
x, y = proj_geom.xy
axes.plot(x, y, color=COLOR_COAST, linewidth=0.5)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index deb2a53a..31b81d3f 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -35,6 +35,7 @@ import bibstyle
extensions = [
'sphinx.ext.mathjax',
'sphinxcontrib.bibtex',
+ 'sphinxcontrib.spelling',
'breathe',
'redirects',
]
diff --git a/docs/source/operations/projections/bertin1953.rst b/docs/source/operations/projections/bertin1953.rst
index 8be521f3..a525925c 100644
--- a/docs/source/operations/projections/bertin1953.rst
+++ b/docs/source/operations/projections/bertin1953.rst
@@ -45,7 +45,7 @@ The Bertin 1953 projection has no special options. Its rotation parameters
are fixed. Here is an example of a forward projection with scale 1:
$ echo 122 47 | src/proj +proj=bertin1953 +R=1
- 0.72 0.73
+ 0.72 0.73
Parameters
################################################################################
diff --git a/docs/source/operations/projections/cass.rst b/docs/source/operations/projections/cass.rst
index a263575e..95684e51 100644
--- a/docs/source/operations/projections/cass.rst
+++ b/docs/source/operations/projections/cass.rst
@@ -41,12 +41,12 @@ The Cassini-Soldner was also used for the detailed mapping of many German states
Example using EPSG 30200 (Trinidad 1903, units in clarke's links)::
$ echo 0.17453293 -1.08210414 | proj +proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46392051999 +y_0=65379.0134283 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.201166195164
- 66644.94 82536.22
+ 66644.94 82536.22
Example using EPSG 3068 (Soldner Berlin)::
$ echo 13.5 52.4 | proj +proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +units=m
- 31343.05 7932.76
+ 31343.05 7932.76
Options
################################################################################
diff --git a/docs/source/operations/projections/ccon.rst b/docs/source/operations/projections/ccon.rst
index 07d2eaf4..949da8b5 100644
--- a/docs/source/operations/projections/ccon.rst
+++ b/docs/source/operations/projections/ccon.rst
@@ -132,11 +132,11 @@ It should result with
::
- 1.384023E+01 5.503040E+01 0.000000E+00
- 1.451445E+01 4.877385E+01 0.000000E+00
- 2.478271E+01 5.500352E+01 0.000000E+00
- 2.402761E+01 4.875048E+01 0.000000E+00
- 1.900000E+01 5.200000E+01 0.000000E+00
+ 1.384023E+01 5.503040E+01 0.000000E+00
+ 1.451445E+01 4.877385E+01 0.000000E+00
+ 2.478271E+01 5.500352E+01 0.000000E+00
+ 2.402761E+01 4.875048E+01 0.000000E+00
+ 1.900000E+01 5.200000E+01 0.000000E+00
Analogous script can be run for reverse test:
@@ -153,7 +153,7 @@ and it should give the following results:
::
- 6.500315E+05 4.106162E+03 0.000000E+00
- 3.707419E+04 6.768262E+05 0.000000E+00
- 6.960534E+05 6.722946E+05 0.000000E+00
- 3.300000E+05 3.500000E+05 0.000000E+00
+ 6.500315E+05 4.106162E+03 0.000000E+00
+ 3.707419E+04 6.768262E+05 0.000000E+00
+ 6.960534E+05 6.722946E+05 0.000000E+00
+ 3.300000E+05 3.500000E+05 0.000000E+00
diff --git a/docs/source/operations/projections/eqearth.rst b/docs/source/operations/projections/eqearth.rst
index 80bfd411..bb6d22ce 100644
--- a/docs/source/operations/projections/eqearth.rst
+++ b/docs/source/operations/projections/eqearth.rst
@@ -32,7 +32,7 @@ Equal Earth
proj-string: ``+proj=eqearth``
-The Equal Earth projection is intended for making world maps. Equal Earth is a
+The Equal Earth projection is intended for making world maps. Equal Earth is a
projection inspired by the Robinson projection, but unlike
the Robinson projection retains the relative size of areas. The projection
was designed in 2018 by Bojan Savric, Tom Patterson and Bernhard Jenny :cite:`Savric2018`.
@@ -45,7 +45,7 @@ The Equal Earth projection has no special options. Here is
an example of an forward projection on a sphere with a radius of 1 m::
$ echo 122 47 | src/proj +proj=eqearth +R=1
- 1.55 0.89
+ 1.55 0.89
Parameters
################################################################################
diff --git a/docs/source/operations/projections/gall.rst b/docs/source/operations/projections/gall.rst
index ba7de8e3..c5f05478 100644
--- a/docs/source/operations/projections/gall.rst
+++ b/docs/source/operations/projections/gall.rst
@@ -46,12 +46,12 @@ Unlike the Mercator, the Gall shows the poles as lines running across the top an
Example using Gall Stereographical ::
$ echo 9 51 | proj +proj=gall +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +units=m
- 708432.90 5193386.36
+ 708432.90 5193386.36
Example using Gall Stereographical (Central meridian 90°W) ::
$ echo 9 51 | proj +proj=gall +lon_0=90w +x_0=0 +y_0=0 +ellps=WGS84 +units=m
- 7792761.91 5193386.36
+ 7792761.91 5193386.36
Parameters
################################################################################
diff --git a/docs/source/operations/projections/tmerc.rst b/docs/source/operations/projections/tmerc.rst
index cf428cff..942a31ed 100644
--- a/docs/source/operations/projections/tmerc.rst
+++ b/docs/source/operations/projections/tmerc.rst
@@ -63,12 +63,12 @@ The following table gives special cases of the Transverse Mercator projection.
Example using Gauss-Kruger on Germany area (aka EPSG:31467) ::
$ echo 9 51 | proj +proj=tmerc +lat_0=0 +lon_0=9 +k_0=1 +x_0=3500000 +y_0=0 +ellps=bessel +units=m
- 3500000.00 5651505.56
+ 3500000.00 5651505.56
Example using Gauss Boaga on Italy area (EPSG:3004) ::
$ echo 15 42 | proj +proj=tmerc +lat_0=0 +lon_0=15 +k_0=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +units=m
- 2520000.00 4649858.60
+ 2520000.00 4649858.60
Parameters
################################################################################
diff --git a/docs/source/usage/transformation.rst b/docs/source/usage/transformation.rst
index 1db63a21..1f29126e 100644
--- a/docs/source/usage/transformation.rst
+++ b/docs/source/usage/transformation.rst
@@ -209,11 +209,11 @@ With PROJ 6, you can simply use the following:
cs2cs "GGRS87" "WGS 84"
35 20
- 35d0'9.575"N 20d0'5.467"E 0.000
+ 35d0'9.575"N 20d0'5.467"E 0.000
cs2cs EPSG:4121 EPSG:4326
35 20
- 35d0'9.575"N 20d0'5.467"E 0.000
+ 35d0'9.575"N 20d0'5.467"E 0.000
The EPSG database provides this example for transforming from WGS72 to WGS84
using an approximated 7 parameter transformation.
@@ -232,11 +232,11 @@ latitude and longitude)
cs2cs "WGS 72" "WGS 84"
55 4
- 55d0'0.09"N 4d0'0.554"E 0.000
+ 55d0'0.09"N 4d0'0.554"E 0.000
cs2cs EPSG:4322 EPSG:4326
55 4
- 55d0'0.09"N 4d0'0.554"E 0.000
+ 55d0'0.09"N 4d0'0.554"E 0.000
Grid Based Datum Adjustments