From 4578e9c7ae264ad706876cc2bb6a412ff1681fe0 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 1 Apr 2018 20:48:22 +0200 Subject: Add tests extra test cases for the gnomonic projection --- test/gie/builtins.gie | 110 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 92 insertions(+), 18 deletions(-) diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 9cfb7cce..27d5c143 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -1366,28 +1366,102 @@ Gnomonic =============================================================================== ------------------------------------------------------------------------------- -operation +proj=gnom +a=6400000 +lat_1=0.5 +lat_2=2 +Test material from Snyder p. 168, table 26. +Tests the equatorial aspect of the projection. +------------------------------------------------------------------------------- +operation +proj=gnom +R=1 ------------------------------------------------------------------------------- tolerance 0.1 mm -accept 2 1 -expect 223492.924747185 111780.509206593 -accept 2 -1 -expect 223492.924747185 -111780.509206593 -accept -2 1 -expect -223492.924747185 111780.509206593 -accept -2 -1 -expect -223492.924747185 -111780.509206593 +accept 0 0 +expect 0 0 +roundtrip 100 +accept 10 80 +expect 0.1763 5.7588 +roundtrip 100 +accept 20 70 +expect 0.3640 2.9238 +roundtrip 100 +accept 30 60 +expect 0.5774 2.0000 +roundtrip 100 +accept 40 50 +expect 0.8391 1.5557 +roundtrip 100 +accept 50 40 +expect 1.1918 1.3054 +roundtrip 100 +accept 60 30 +expect 1.7321 1.1547 +roundtrip 100 +accept 70 20 +expect 2.7475 1.0642 +roundtrip 100 +accept 80 10 +expect 5.6713 1.0154 +roundtrip 100 +accept 80 80 +expect 5.6713 32.6596 +roundtrip 100 +accept 0 90 +expect failure errno tolerance_condition -direction inverse -accept 200 100 -expect 0.001790493 0.000895247 -accept 200 -100 -expect 0.001790493 -0.000895247 -accept -200 100 -expect -0.001790493 0.000895247 -accept -200 -100 -expect -0.001790493 -0.000895247 +# test that extreme northings are mapped to the sphere +direction inverse +accept 0 1e8 +expect 0 90 + + +------------------------------------------------------------------------------- +Test the northern polar aspect of the gnonomic projection +------------------------------------------------------------------------------- +operation +proj=gnom +R=1 +lat_0=90 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 90 +expect 0 0 +roundtrip 100 +accept 45 45 +expect 0.7071 -0.7071 +roundtrip 100 +accept 0 0 +expect failure errno tolerance_condition +accept 90 0 +expect failure errno tolerance_condition +------------------------------------------------------------------------------- +Test the sourthern polar aspect of the gnonomic projection +------------------------------------------------------------------------------- +operation +proj=gnom +R=1 +lat_0=-90 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 -90 +expect 0 0 +roundtrip 100 +accept 45 -45 +expect 0.7071 0.7071 +roundtrip 100 +accept 0 0 +expect failure errno tolerance_condition +accept 90 0 +expect failure errno tolerance_condition + +------------------------------------------------------------------------------- +Test the oblique aspect of the gnonomic projection +------------------------------------------------------------------------------- +operation +proj=gnom +R=1 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 45 +expect 0 0 +roundtrip 100 +accept 0 0 +expect 0 -1 +roundtrip 100 +accept 0 90 +expect 0 1 +roundtrip 100 +accept 0 -45 +expect failure errno tolerance_condition =============================================================================== Goode Homolosine -- cgit v1.2.3 From 1777869afa75e3e9ee3cdc4fd0b777d05b4f51d6 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 2 Apr 2018 00:28:05 +0200 Subject: Add test cases for aeqd projection --- test/gie/builtins.gie | 252 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 217 insertions(+), 35 deletions(-) diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 27d5c143..4d744135 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -71,51 +71,233 @@ Azimuthal Equidistant =============================================================================== ------------------------------------------------------------------------------- -operation +proj=aeqd +ellps=GRS80 +lat_1=0.5 +lat_2=2 +Test equatorial aspect of the spherical azimuthal equidistant. Test data from +Snyder pp. 196-197, table 30. +------------------------------------------------------------------------------- +operation +proj=aeqd +R=1 +lat_0=0 ------------------------------------------------------------------------------- tolerance 0.1 mm -accept 2 1 -expect 222616.522190052 110596.996549550 -accept 2 -1 -expect 222616.522190052 -110596.996549550 -accept -2 1 -expect -222616.522190052 110596.996549550 -accept -2 -1 -expect -222616.522190052 -110596.996549550 +accept 0 0 +expect 0 0 +roundtrip 100 +accept 0 90 +expect 0 1.57080 +roundtrip 100 +accept 10 80 +expect 0.04281 1.39829 +roundtrip 100 +accept 40 30 +expect 0.62896 0.56493 +roundtrip 100 +accept 90 0 +expect 1.57080 0 +roundtrip 100 +accept 90 90 +expect 0 1.57080 +roundtrip 100 -direction inverse -accept 200 100 -expect 0.001796631 0.000904369 -accept 200 -100 -expect 0.001796631 -0.000904369 -accept -200 100 -expect -0.001796631 0.000904369 -accept -200 -100 -expect -0.001796631 -0.000904369 +# point opposite projection center is undefined +accept 180 0 +expect failure errno tolerance_condition ------------------------------------------------------------------------------- -operation +proj=aeqd +R=6400000 +lat_1=0.5 +lat_2=2 +Test equatorial aspect of the ellipsoidal azimuthal equidistant. Test data from +Snyder pp. 196-197, table 30. +------------------------------------------------------------------------------- +operation +proj=aeqd +ellps=GRS80 +lat_0=0 ------------------------------------------------------------------------------- tolerance 0.1 mm -accept 2 1 -expect 223379.456047271 111723.757570854 -accept 2 -1 -expect 223379.456047271 -111723.757570854 -accept -2 1 -expect -223379.456047271 111723.757570854 -accept -2 -1 -expect -223379.456047271 -111723.757570854 +accept 0 90 +expect 0 10001965.7292 +roundtrip 100 +accept 0 0 +expect 0 0 +roundtrip 100 +accept 90 0 +expect 10_018_754.1714 0 +roundtrip 100 +accept 90 0 +expect 10_018_754.1714 0 +roundtrip 100 +accept 45 45 +expect 3_860_398.3783 5_430_089.0490 +roundtrip 100 + +------------------------------------------------------------------------------- +Test equatorial aspect of the ellipsoidal azimuthal equidistant. Test data from +Snyder pp. 196-197, table 30. +------------------------------------------------------------------------------- +operation +proj=aeqd +ellps=GRS80 +guam +------------------------------------------------------------------------------- +tolerance 1 m +accept 0 0 +expect 0.0000 0.0000 +roundtrip 100 +accept 90 90 +except 0.0000 10_001_965.7292 +roundtrip 100 +accept 0 90 +expect 0.0000 10_001_965.7292 +roundtrip 100 +accept 90 90 +expect 0.0000 10_001_965.7292 +roundtrip 100 +accept 45 45 +expect 3548107.5793 5970183.542 +#roundtrip 100 +accept -45 -45 +expect -3548107.5793 -5970183.542 +#roundtrip 100 + +------------------------------------------------------------------------------- +Test northern polar aspect of the ellipsoidal azimuthal equidistant. Test data +from Snyder p. 198, table 31. +------------------------------------------------------------------------------- +operation +proj=aeqd +ellps=intl +lat_0=90 +------------------------------------------------------------------------------- +tolerance 0.1 m +accept 0 90 +expect 0 0 +roundtrip 100 +accept 0 85 +expect 0 -558_485.4 +roundtrip 100 +accept 0 80 +expect 0 -1_116_885.2 +roundtrip 100 +accept 0 70 +expect 0 -2_233_100.9 +roundtrip 100 + +------------------------------------------------------------------------------- +Test sourthern polar aspect of the ellipsoidal azimuthal equidistant. Test data +from Snyder p. 198, table 31. +------------------------------------------------------------------------------- +operation +proj=aeqd +ellps=intl +lat_0=-90 +------------------------------------------------------------------------------- +tolerance 0.1 m +accept 0 -90 +expect 0 0 +roundtrip 100 +accept 0 -85 +expect 0 558_485.4 +roundtrip 100 +accept 0 -80 +expect 0 1_116_885.2 +roundtrip 100 +accept 0 -70 +expect 0 2_233_100.9 +roundtrip 100 + +------------------------------------------------------------------------------- +Test northern polar aspect of the spherical azimuthal equidistant. +------------------------------------------------------------------------------- +operation +proj=aeqd +R=1 +lat_0=90 +------------------------------------------------------------------------------- +tolerance 0.1 m +accept 0 0 +expect 0 -1.5708 +roundtrip 100 +accept 0 90 +expect 0 0 +roundtrip 100 +accept 90 90 +expect 0 0 +roundtrip 100 +accept 90 0 +expect 1.5708 0 +roundtrip 100 +accept 45 45 +expext 0.5554 -0.5554 +roundtrip 100 + +#point opposite of projection center is undefined +accept 0 -90 +expect failure errno tolerance_condition direction inverse -accept 200 100 -expect 0.001790493 0.000895247 -accept 200 -100 -expect 0.001790493 -0.000895247 -accept -200 100 -expect -0.001790493 0.000895247 -accept -200 -100 -expect -0.001790493 -0.000895247 +accept 0 5 +expect failure errno tolerance_condition + +accept 0 3.14159265359 +expect 180 -90 +------------------------------------------------------------------------------- +Test sourthnern polar aspect of the spherical azimuthal equidistant. +------------------------------------------------------------------------------- +operation +proj=aeqd +R=1 +lat_0=-90 +------------------------------------------------------------------------------- +tolerance 0.1 m +accept 0 0 +expect 0 1.5708 +roundtrip 100 +accept 0 -90 +expect 0 0 +roundtrip 100 +accept 90 -90 +expect 0 0 +roundtrip 100 +accept 90 0 +expect 1.5708 0 +roundtrip 100 +accept 45 -45 +expext 0.5554 -0.5554 +roundtrip 100 + +#point opposite of projection center is undefined +accept 0 90 +expect failure errno tolerance_condition + + +------------------------------------------------------------------------------- +Test oblique aspect of the spherical azimuthal equidistant. +------------------------------------------------------------------------------- +operation +proj=aeqd +R=1 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 m +accept 0 0 +expect 0.0000 -0.7854 +roundtrip 100 +accept 0 45 +expect 0.0000 0.0000 +roundtrip 100 +accept 0 90 +expect 0.0000 0.7854 +roundtrip 100 +accept 90 0 +expect 1.5708 -0.0000 +roundtrip 100 +accept 90 45 +expect 0.8550 0.6046 +#roundtrip 100 # roundtrip performs badly for this test on some platforms +accept 90 90 +expect 0.0000 0.7854 +roundtrip 100 + +------------------------------------------------------------------------------- +Test oblique aspect of the ellipsoidal azimuthal equidistant. +------------------------------------------------------------------------------- +operation +proj=aeqd +ellps=GRS80 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 m +accept 0 0 +expect 0.0000 -4984944.3779 +roundtrip 100 +accept 0 45 +expect 0.0000 0.0000 +roundtrip 100 +accept 0 90 +expect 0.0000 5017021.3514 +roundtrip 100 +accept 90 0 +expect 10010351.5666 26393.3781 +roundtrip 100 +accept 90 45 +expect 5461910.9128 3863514.7047 +roundtrip 100 +accept 90 90 +expect 0.0000 5017021.3514 +roundtrip 100 =============================================================================== Airy -- cgit v1.2.3 From a2f807b330f1cec10b2e3484d296ed73ca040ca2 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 3 Apr 2018 11:53:22 +0200 Subject: Update documentation for 5.0.1 --- docs/source/conf.py | 2 +- docs/source/download.rst | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index a269a7d9..fa1de3ed 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -58,7 +58,7 @@ author = u'Gerald Evenden, Frank Warmerdam, and others' # built documents. # # The short X.Y version. -version = u'5.0.0' +version = u'5.0.1' # The full version, including alpha/beta/rc tags. release = u'5.0.0' diff --git a/docs/source/download.rst b/docs/source/download.rst index 784bb756..d7c60d63 100644 --- a/docs/source/download.rst +++ b/docs/source/download.rst @@ -15,7 +15,7 @@ Release Notes Current Release -------------------------------------------------------------------------------- -* **2018-03-01** `proj-5.0.0.tar.gz`_ (`md5`_) +* **2018-04-01** `proj-5.0.1.tar.gz`_ (`md5`_) * **2018-03-01** `proj-datumgrid-1.7.zip`_ * **2018-03-01** `proj-datumgrid-europe-1.0.zip`_ * **2018-03-01** `proj-datumgrid-north-america-1.0.zip`_ @@ -24,12 +24,14 @@ Current Release Past Releases -------------------------------------------------------------------------------- +* **2018-03-01** `proj-5.0.0.tar.gz`_ * **2016-09-02** `proj-4.9.3.tar.gz`_ * **2015-09-13** `proj-4.9.2.tar.gz`_ * **2015-03-04** `proj-4.9.1.tar.gz`_ * **2016-09-11** `proj-datumgrid-1.6.zip`_ +.. _`proj-5.0.1.tar.gz`: http://download.osgeo.org/proj/proj-5.0.1.tar.gz .. _`proj-5.0.0.tar.gz`: http://download.osgeo.org/proj/proj-5.0.0.tar.gz .. _`proj-4.9.1.tar.gz`: http://download.osgeo.org/proj/proj-4.9.1.tar.gz .. _`proj-4.9.2.tar.gz`: http://download.osgeo.org/proj/proj-4.9.2.tar.gz @@ -39,7 +41,7 @@ Past Releases .. _`proj-datumgrid-europe-1.0.zip`: http://download.osgeo.org/proj/proj-datumgrid-europe-1.0.zip .. _`proj-datumgrid-north-america-1.0.zip`: http://download.osgeo.org/proj/proj-datumgrid-north-america-1.0.zip .. _`proj-datumgrid-oceania-1.0.zip`: http://download.osgeo.org/proj/proj-datumgrid-oceania-1.0.zip -.. _`md5`: http://download.osgeo.org/proj/proj-5.0.0.tar.gz.md5 +.. _`md5`: http://download.osgeo.org/proj/proj-5.0.1.tar.gz.md5 Binaries -------------------------------------------------------------------------------- -- cgit v1.2.3 From fa2fcad163b8068d418fba1924a19f35b071d7d3 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 3 Apr 2018 11:54:36 +0200 Subject: Add yyyymmdd temporal unit to unitconvert docs --- docs/source/operations/conversions/unitconvert.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/operations/conversions/unitconvert.rst b/docs/source/operations/conversions/unitconvert.rst index 50ac832c..bc422afb 100644 --- a/docs/source/operations/conversions/unitconvert.rst +++ b/docs/source/operations/conversions/unitconvert.rst @@ -109,4 +109,6 @@ In the table below all time units supported by PROJ is listed. +--------------+-----------------------------+ | gps_week | GPS Week | +--------------+-----------------------------+ +| yyyymmdd | Date in yyyymmdd format | ++--------------+-----------------------------+ -- cgit v1.2.3 From e2ce502a6eebd1250329f602e79bab1171f57403 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 3 Apr 2018 17:02:25 +0200 Subject: Remove proj.spec file The file seem to be unused by the packagers and we don't use ourselves. Instead of trying to keep it up to date with each release we might as well get rid of the thing. --- HOWTO-RELEASE | 18 ++++++------------ proj.spec | 51 --------------------------------------------------- 2 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 proj.spec diff --git a/HOWTO-RELEASE b/HOWTO-RELEASE index 3053523b..d020d486 100644 --- a/HOWTO-RELEASE +++ b/HOWTO-RELEASE @@ -46,33 +46,27 @@ 7) Update NEWS file with summary of release changes. -8) Update the proj.spec file for the new version: - - PACKAGE_VERSION - - Source0 - - %setup line - - rm -rf line - -9) If this is a major release, prepare a branch. +8) If this is a major release, prepare a branch. git checkout -b 5.0 -10) Tag the release +9) Tag the release git tag 5.0.0 -11) Do a "make dist-all" in the proj root directory. After some grinding +10) Do a "make dist-all" in the proj root directory. After some grinding this should result in files like proj-4.4.3.tar.gz and proj-4.4.3.zip being created. These are full source distributions. -12) Put these in the proj ftp area on /osgeo/download/proj on +11) Put these in the proj ftp area on /osgeo/download/proj on download.osgeo.org. This can be done via scp using a command like the following. scp proj-4.4.3.{tar.gz,zip} warmerdam@download.osgeo.org:/osgeo/download/proj -13) Announce the new release on the PROJ.4 and MetaCRS mailing lists. +12) Announce the new release on the PROJ.4 and MetaCRS mailing lists. -14) Issue a new release report on GitHub: +13) Issue a new release report on GitHub: https://github.com/OSGeo/proj.4/releases/new diff --git a/proj.spec b/proj.spec deleted file mode 100644 index b0854077..00000000 --- a/proj.spec +++ /dev/null @@ -1,51 +0,0 @@ -%define PACKAGE_NAME proj -%define PACKAGE_VERSION 5.0.0 -%define PACKAGE_URL http://proj4.org -%define _prefix /usr - -Summary: Cartographic projection and geodetic transformation software -Name: %PACKAGE_NAME -Version: %PACKAGE_VERSION -Release: 1 -Source0: proj-5.0.0.tar.gz -License: MIT, Copyright (c) 2000, Frank Warmerdam -Group: Applications/GIS -Vendor: Intevation GmbH -Distribution: FreeGIS CD - -BuildRoot: %{_builddir}/%{name}-root -Prefix: %{_prefix} -BuildRequires: libtool -Conflicts: PROJ.4 - -%description -PROJ is a generic coordinate transformation software, that transforms -coordinates from one coordinate reference system (CRS) to another. This -includes cartographic projections as well as geodetic transformations. - -%prep -%setup -D -n proj-5.0.0 -%{_builddir}/%{name}-%{version}/autogen.sh -%configure - -%build -make - -%install -rm -rf $RPM_BUILD_ROOT -%makeinstall - -%clean -rm -rf %{_builddir}/proj-5.0.0 -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%{_libdir}/* -%{_bindir}/* -%{_includedir}/* -%{_datadir}/proj/* -%{_mandir}/man1/* -%{_mandir}/man3/* - -%doc AUTHORS COPYING ChangeLog NEWS README.md -- cgit v1.2.3 From 51967aa03df0bbe134c38475a2633430dddefc82 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 3 Apr 2018 17:45:23 +0200 Subject: Add --skip-lines option to cct With this it is possible to skip the header when transforming coordinates from a file. --- docs/source/apps/cct.rst | 7 +++++++ src/cct.c | 24 ++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/docs/source/apps/cct.rst b/docs/source/apps/cct.rst index dc2944f2..20aec06c 100644 --- a/docs/source/apps/cct.rst +++ b/docs/source/apps/cct.rst @@ -44,6 +44,13 @@ The following control parameters can appear in any order: Specify a fixed observation height to be used for all input data. +.. option:: s , --skip-lines= + + .. versionadded:: 5.1.0 + + Skip the first *n* lines of input. This applies to any kind of input, wether + it comes from ``STDIN``, a file or interactive user input. + .. option:: -v, --verbose Write non-essential, but potentially useful, information to stderr. diff --git a/src/cct.c b/src/cct.c index 6b8f35f3..2952f2b7 100644 --- a/src/cct.c +++ b/src/cct.c @@ -105,6 +105,7 @@ static const char usage[] = { " -z value Provide a fixed z value for all input data (e.g. -z 0)\n" " -t value Provide a fixed t value for all input data (e.g. -t 0)\n" " -I Do the inverse transformation\n" + " -s n Skip n first lines of a infile\n" " -v Verbose: Provide non-essential informational output.\n" " Repeat -v for more verbosity (e.g. -vv)\n" "--------------------------------------------------------------------------------\n" @@ -116,6 +117,7 @@ static const char usage[] = { " --time Alias for -t\n" " --verbose Alias for -v\n" " --inverse Alias for -I\n" + " --skip-lines Alias for -s\n" " --help Alias for -h\n" " --version Print version number\n" "--------------------------------------------------------------------------------\n" @@ -156,13 +158,19 @@ int main(int argc, char **argv) { OPTARGS *o; FILE *fout = stdout; char *buf; - int nfields = 4, direction = 1, verbose; + int nfields = 4, direction = 1, skip_lines = 0, verbose; double fixed_z = HUGE_VAL, fixed_time = HUGE_VAL; int columns_xyzt[] = {1, 2, 3, 4}; const char *longflags[] = {"v=verbose", "h=help", "I=inverse", "version", 0}; - const char *longkeys[] = {"o=output", "c=columns", "z=height", "t=time", 0}; - - o = opt_parse (argc, argv, "hvI", "cozt", longflags, longkeys); + const char *longkeys[] = { + "o=output", + "c=columns", + "z=height", + "t=time", + "s=skip-lines", + 0}; + + o = opt_parse (argc, argv, "hvI", "cozts", longflags, longkeys); if (0==o) return 0; @@ -202,6 +210,10 @@ int main(int argc, char **argv) { nfields--; } + if (opt_given (o, "s")) { + skip_lines = atoi (opt_arg(o, "s")); + } + if (opt_given (o, "c")) { /* cppcheck-suppress invalidscanf */ int ncols = sscanf (opt_arg (o, "c"), "%d,%d,%d,%d", columns_xyzt, columns_xyzt+1, columns_xyzt+2, columns_xyzt+3); @@ -265,6 +277,10 @@ int main(int argc, char **argv) { continue; } point = parse_input_line (buf, columns_xyzt, fixed_z, fixed_time); + if (skip_lines > 0) { + skip_lines--; + continue; + } if (HUGE_VAL==point.xyzt.x) { char *c = column (buf, 1); -- cgit v1.2.3 From 053b7e3e45b0ce60cde462a9d590afd6d4682cd1 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 3 Apr 2018 19:32:53 +0200 Subject: Add 'echo' and 'skip' command to gie docs --- docs/source/apps/gie.rst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/source/apps/gie.rst b/docs/source/apps/gie.rst index eee0e22d..777c5833 100644 --- a/docs/source/apps/gie.rst +++ b/docs/source/apps/gie.rst @@ -260,6 +260,46 @@ gie command language See ``gie -l`` for a list of error codes that can be ignored. +.. option:: echo + + Add user defined text to the output stream. See the example below. + + .. code-block:: console + + + echo ** Mercator projection tests ** + operation +proj=merc + accept 0 0 + expect 0 0 + + + which returns + + .. code-block:: console + + ------------------------------------------------------------------------------- + Reading file 'test.gie' + ** Mercator projection test ** + ------------------------------------------------------------------------------- + total: 1 tests succeeded, 0 tests skipped, 0 tests failed. + ------------------------------------------------------------------------------- + +.. option:: skip + + Skip any test after the first occurence of :option:`skip`. In the example below only + the first test will be performed. The second test is skipped. This feature is mostly + relevant for debugging when writing new test cases. + + .. code-block:: console + + + operation proj=merc + accept 0 0 + expect 0 0 + skip + accept 0 1 + expect 0 110579.9 + Background ********** -- cgit v1.2.3 From 64922f1694fba917c92116b0f595e76d2304046b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 1 Apr 2018 19:50:34 +0200 Subject: Add a CITATION file (fixes #309) --- CITATION | 14 ++++++++++++++ HOWTO-RELEASE | 14 ++++++++------ Makefile.am | 2 +- README.md | 4 ++++ 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 CITATION diff --git a/CITATION b/CITATION new file mode 100644 index 00000000..82643d84 --- /dev/null +++ b/CITATION @@ -0,0 +1,14 @@ +To cite PROJ in publications use: + + PROJ contributors (2018). PROJ coordinate transformation software + library. Open Source Geospatial Foundation. URL http://proj4.org/. + +A BibTeX entry for LaTeX users is + + @Manual{, + title = {{PROJ} coordinate transformation software library}, + author = {{PROJ contributors}}, + organization = {Open Source Geospatial Foundation}, + year = {2018}, + url = {http://proj4.org/}, + } diff --git a/HOWTO-RELEASE b/HOWTO-RELEASE index d020d486..fbf99670 100644 --- a/HOWTO-RELEASE +++ b/HOWTO-RELEASE @@ -46,27 +46,29 @@ 7) Update NEWS file with summary of release changes. -8) If this is a major release, prepare a branch. +8) Update the year in CITATION + +9) If this is a major release, prepare a branch. git checkout -b 5.0 -9) Tag the release +10) Tag the release git tag 5.0.0 -10) Do a "make dist-all" in the proj root directory. After some grinding +11) Do a "make dist-all" in the proj root directory. After some grinding this should result in files like proj-4.4.3.tar.gz and proj-4.4.3.zip being created. These are full source distributions. -11) Put these in the proj ftp area on /osgeo/download/proj on +12) Put these in the proj ftp area on /osgeo/download/proj on download.osgeo.org. This can be done via scp using a command like the following. scp proj-4.4.3.{tar.gz,zip} warmerdam@download.osgeo.org:/osgeo/download/proj -12) Announce the new release on the PROJ.4 and MetaCRS mailing lists. +13) Announce the new release on the PROJ.4 and MetaCRS mailing lists. -13) Issue a new release report on GitHub: +14) Issue a new release report on GitHub: https://github.com/OSGeo/proj.4/releases/new diff --git a/Makefile.am b/Makefile.am index f4a82f9c..39a1201b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = src man nad jniwrap cmake test -EXTRA_DIST = makefile.vc nmake.opt CMakeLists.txt +EXTRA_DIST = makefile.vc nmake.opt CMakeLists.txt CITATION pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = proj.pc diff --git a/README.md b/README.md index 32e3df66..981be967 100644 --- a/README.md +++ b/README.md @@ -144,3 +144,7 @@ where PROJ will find them after installation. The default location of `PROJ_LIB` on UNIX-based systems is `/usr/local/share/proj` but it may be changed to a different directory. On Windows you have to define `PROJ_LIB` yourself. + +### Citing PROJ in publications + +See [CITATION](CITATION) -- cgit v1.2.3 From ac78787bf3bfa15dabbbad0042ca762020542365 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 7 Apr 2018 15:35:08 +0200 Subject: Pipeline: make sure geocentric/cartesian space transform is done with original ellipsoid parameters (before any projection mess with them) --- src/PJ_pipeline.c | 2 ++ src/proj_4D_api.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PJ_pipeline.c b/src/PJ_pipeline.c index b60e05a8..aa7d76f8 100644 --- a/src/PJ_pipeline.c +++ b/src/PJ_pipeline.c @@ -306,6 +306,8 @@ static void set_ellipsoid(PJ *P) { /* the PJ you provided". */ proj_errno_reset (P); } + P->a_orig = P->a; + P->es_orig = P->es; pj_calc_ellipsoid_params (P, P->a, P->es); diff --git a/src/proj_4D_api.c b/src/proj_4D_api.c index 11a56ac0..aed4685b 100644 --- a/src/proj_4D_api.c +++ b/src/proj_4D_api.c @@ -485,7 +485,7 @@ Returns 1 on success, 0 on failure if (0==d[0] && 0==d[1] && 0==d[2] && 0==d[3] && 0==d[4] && 0==d[5] && 0==d[6]) { /* If the current ellipsoid is not WGS84, then make sure the */ /* change in ellipsoid is still done. */ - if (!(fabs(P->a - 6378137.0) < 1e-8 && fabs(P->f - 1./ 298.257223563) < 1e-15)) { + if (!(fabs(P->a_orig - 6378137.0) < 1e-8 && fabs(P->es_orig - 0.0066943799901413) < 1e-15)) { do_cart = 1; } break; @@ -512,7 +512,7 @@ Returns 1 on success, 0 on failure /* geocentric/cartesian space or we need to do a Helmert transform. */ if (P->is_geocent || P->helmert || do_cart) { char def[150]; - sprintf (def, "break_cs2cs_recursion proj=cart a=%40.20g f=%40.20g", P->a, P->f); + sprintf (def, "break_cs2cs_recursion proj=cart a=%40.20g es=%40.20g", P->a_orig, P->es_orig); Q = proj_create (P->ctx, def); if (0==Q) return 0; -- cgit v1.2.3 From 3bcd7bb02392d6ecda5b2a49854d855c92bfcbd4 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 8 Apr 2018 17:26:55 +0200 Subject: Override style of Sphinx versionmodified directives so they stand out more clearly in the text --- docs/source/_static/theme_overrides.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/_static/theme_overrides.css b/docs/source/_static/theme_overrides.css index b82d2881..4e612939 100644 --- a/docs/source/_static/theme_overrides.css +++ b/docs/source/_static/theme_overrides.css @@ -55,3 +55,16 @@ div.math { overflow-x: auto; overflow-y: hidden; } + +/* Override style of versionmodified directives */ +.versionadded { + font-style: italic; +} + +.versionchanged { + font-style: italic; +} + +.deprecated { + font-style: italic; +} -- cgit v1.2.3 From 89af2753651f8c21eae9df631a71c0a3b03bcc3b Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 9 Apr 2018 02:02:26 +0200 Subject: Fix bad example in eqc docs --- docs/source/operations/projections/eqc.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/source/operations/projections/eqc.rst b/docs/source/operations/projections/eqc.rst index be431977..5833bd61 100644 --- a/docs/source/operations/projections/eqc.rst +++ b/docs/source/operations/projections/eqc.rst @@ -64,9 +64,8 @@ Example using EPSG 32662 (WGS84 Plate Carrée):: Example using Plate Carrée projection with true scale at latitude 30° and central meridian 90°W:: - $ echo -88 30 | proj +proj=eqc +lat_ts=30 +lat_0=90w - -8483684.61 13358338.90 - + $ echo -88 30 | proj +proj=eqc +lat_ts=30 +lon_0=90w + 192811.01 3339584.72 Mathematical definition ####################### -- cgit v1.2.3 From 3a2ddb6c6efbccf388ea89e177ca51fd25946ecf Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 7 Apr 2018 13:41:12 +0200 Subject: Add webmerc projection --- docs/source/operations/projections/index.rst | 1 + docs/source/operations/projections/webmerc.rst | 78 ++++++++++++++++++++++++++ src/PJ_merc.c | 17 ++++++ src/pj_list.h | 1 + test/gie/4D-API_cs2cs-style.gie | 13 +++++ 5 files changed, 110 insertions(+) create mode 100644 docs/source/operations/projections/webmerc.rst diff --git a/docs/source/operations/projections/index.rst b/docs/source/operations/projections/index.rst index 9255d9fd..77decd6c 100644 --- a/docs/source/operations/projections/index.rst +++ b/docs/source/operations/projections/index.rst @@ -141,6 +141,7 @@ Projections map the spherical 3D space to a flat 2D space. wag5 wag6 wag7 + webmerc weren wink1 wink2 diff --git a/docs/source/operations/projections/webmerc.rst b/docs/source/operations/projections/webmerc.rst new file mode 100644 index 00000000..0c465afc --- /dev/null +++ b/docs/source/operations/projections/webmerc.rst @@ -0,0 +1,78 @@ +.. _webmerc: + +******************************************************************************** +Web Mercator / Pseudo Mercator +******************************************************************************** + +The Web Mercator / Pseudo Mercator projection is a cylindrical map projection. +This is a variant of the regular :ref:`merc` projection, except that the computation +is done on a sphere, using the semi-major axis of the ellipsoid. + +From `Wikipedia `_: + + This projection is widely used by the Web Mercator, Google Web Mercator, + Spherical Mercator, WGS 84 Web Mercator[1] or WGS 84/Pseudo-Mercator is a + variant of the Mercator projection and is the de facto standard for Web + mapping applications. [...] + It is used by virtually all major online map providers [...] + Its official EPSG identifier is EPSG:3857, although others have been used + historically. + + ++---------------------+----------------------------------------------------------+ +| **Classification** | Cylindrical (non conformant if used with ellipsoid) | ++---------------------+----------------------------------------------------------+ +| **Version** | Added in proj 5.1.0 | ++---------------------+----------------------------------------------------------+ +| **Available forms** | Forward and inverse, spherical projection | ++---------------------+----------------------------------------------------------+ +| **Defined area** | Global, but best used near the equator | ++---------------------+----------------------------------------------------------+ +| **Options** | Neither lat_0, lon_0, lat_ts or k_0 should be used. | ++---------------------+----------------------------------------------------------+ + +Usage +######## + +Example:: + + $ echo 2 49 | proj +proj=webmerc +datum=WGS84 + 222638.98 6274861.39 + +Mathematical definition +####################### + +The formulas describing the Mercator projection are all taken from G. Evenden's libproj manuals [Evenden2005]_. + +Forward projection +================== + +.. math:: + + x = \lambda + +.. math:: + + y = \ln \left[ \tan \left(\frac{\pi}{4} + \frac{\phi}{2} \right) \right] + + +Inverse projection +================== + +.. math:: + + \lambda = {x} + +.. math:: + + \phi = \frac{\pi}{2} - 2 \arctan \left[ e^{-y} \right] + + + +Further reading +############### + +#. `Wikipedia `_ + + + diff --git a/src/PJ_merc.c b/src/PJ_merc.c index 18303c45..a3e5e846 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -1,8 +1,10 @@ #define PJ_LIB__ +#include "proj_internal.h" #include "proj.h" #include "projects.h" PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts="; +PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 @@ -76,3 +78,18 @@ PJ *PROJECTION(merc) { return P; } +PJ *PROJECTION(webmerc) { + + /* Overriding k_0, lat_0 and lon_0 with fixed parameters */ + P->k0 = 1.0; + P->phi0 = 0.0; + P->lam0 = 0.0; + + P->b = P->a; + /* Clean up the ellipsoidal parameters to reflect the sphere */ + P->es = P->e = P->f = 0; + pj_calc_ellipsoid_params (P, P->a, 0); + P->inv = s_inverse; + P->fwd = s_forward; + return P; +} diff --git a/src/pj_list.h b/src/pj_list.h index 09a66034..440f7972 100644 --- a/src/pj_list.h +++ b/src/pj_list.h @@ -156,6 +156,7 @@ PROJ_HEAD(wag4, "Wagner IV") PROJ_HEAD(wag5, "Wagner V") PROJ_HEAD(wag6, "Wagner VI") PROJ_HEAD(wag7, "Wagner VII") +PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") PROJ_HEAD(weren, "Werenskiold I") PROJ_HEAD(wink1, "Winkel I") PROJ_HEAD(wink2, "Winkel II") diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie index bbd9ee39..6eed4faa 100644 --- a/test/gie/4D-API_cs2cs-style.gie +++ b/test/gie/4D-API_cs2cs-style.gie @@ -215,6 +215,19 @@ accept 487147.594520173 4934316.46263998 0 expect -10370728.80 5552839.74 0 ------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +Test that Google's Web Mercator with +proj=webmerc +------------------------------------------------------------------------------- +operation proj=pipeline step init=epsg:26915 inv step proj=webmerc datum=WGS84 +------------------------------------------------------------------------------- +tolerance 20 cm +accept 487147.594520173 4934316.46263998 +expect -10370728.80 5552839.74 + +accept 487147.594520173 4934316.46263998 0 +expect -10370728.80 5552839.74 0 +------------------------------------------------------------------------------- + ------------------------------------------------------------------------------- Test that +datum parameters are handled correctly in pipelines. See #872 for details. -- cgit v1.2.3 From bc8026a46606abf48679d81d80991623d5b91ca7 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 9 Apr 2018 22:27:59 +0200 Subject: Add description of projection and +lat_b parameter --- docs/source/operations/projections/airy.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/source/operations/projections/airy.rst b/docs/source/operations/projections/airy.rst index d2730592..eefda4e9 100644 --- a/docs/source/operations/projections/airy.rst +++ b/docs/source/operations/projections/airy.rst @@ -3,6 +3,11 @@ ******************************************************************************** Airy ******************************************************************************** + +The Airy projection is an azimuthal minimum error projection for the region +within the small or great circle defined by an angular distance, +:math:`\phi_b`, from the tangency point of the plane :math:`( \lambda_0, \phi_0 )`. + +---------------------+----------------------------------------------------------+ | **Classification** | | +---------------------+----------------------------------------------------------+ @@ -14,7 +19,10 @@ Airy +---------------------+----------------------------------------------------------+ | **Options** | +---------------------+----------------------------------------------------------+ -| `+lat_b` | | +| `+lat_b` | Angular distance from tangency point of the plane | +| | :math:`( \lambda_0, \phi_0 )` where the error is kept at | +| | minimum. Defaults to :math:`90^{\circ}` which is | +| | suitable for hemispherical maps. | +---------------------+----------------------------------------------------------+ | `+no_cut` | Do not cut at hemisphere limit | +---------------------+----------------------------------------------------------+ -- cgit v1.2.3 From b7c59722cb0058391e47d2899d510961a0985c59 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 9 Apr 2018 22:28:20 +0200 Subject: Add more test cases for airy projection --- test/gie/builtins.gie | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 4d744135..84d5c832 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -318,6 +318,74 @@ expect -189109.886908621 94583.752387504 accept -2 -1 expect -189109.886908621 -94583.752387504 +------------------------------------------------------------------------------- +Test north polar aspect +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_0=90 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 0 +expect 0 -1.3863 +accept 0 90 +expect 0 0 +accept 0 -90 +expect failure errno tolerance_condition + + +------------------------------------------------------------------------------- +Test south polar aspect +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_0=-90 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 0 +expect 0 1.3863 +accept 0 -90 +expect 0 0 +accept 0 90 +expect failure errno tolerance_condition + +------------------------------------------------------------------------------- +Test oblique aspect +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lon_0=45 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 45 45 +expect 0 0 +accept 0 0 +expext -0.7336 -0.5187 +accept -45 -45 +expect failure errno tolerance_condition + +------------------------------------------------------------------------------- +Test that coordinates on the opposing hemisphere are projected when using ++no_cut. +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_0=-90 +no_cut +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 10 +expect 0 1.5677 + + +------------------------------------------------------------------------------- +Test the +lat_b parameter +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_b=89.99999999 # check tolerance +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 0 +expect 0 0 +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_b=30 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 0 +expect 0 0 +accept 25 25 +expect 0.3821 0.4216 + =============================================================================== Aitoff -- cgit v1.2.3 From 8bd2fc699e61eb3665b7d16d450886a914258933 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Wed, 11 Apr 2018 00:03:03 +0200 Subject: Add more tests for laea --- test/gie/builtins.gie | 151 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 149 insertions(+), 2 deletions(-) diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 4d744135..47d63bf1 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -2143,7 +2143,7 @@ Lambert Azimuthal Equal Area =============================================================================== ------------------------------------------------------------------------------- -operation +proj=laea +ellps=GRS80 +lat_1=0.5 +lat_2=2 +operation +proj=laea +ellps=GRS80 ------------------------------------------------------------------------------- tolerance 0.1 mm accept 2 1 @@ -2155,6 +2155,9 @@ expect -222602.471450095 110589.827224410 accept -2 -1 expect -222602.471450095 -110589.827224409 +accept 180 0 +expect failure errno tolerance_condition + direction inverse accept 200 100 expect 0.001796631 0.000904369 @@ -2166,7 +2169,7 @@ accept -200 -100 expect -0.001796631 -0.000904369 ------------------------------------------------------------------------------- -operation +proj=laea +R=6400000 +lat_1=0.5 +lat_2=2 +operation +proj=laea +R=6400000 ------------------------------------------------------------------------------- tolerance 0.1 mm accept 2 1 @@ -2178,6 +2181,9 @@ expect -223365.281370125 111716.668072916 accept -2 -1 expect -223365.281370125 -111716.668072916 +accept 180 0 +expect failure errno tolerance_condition + direction inverse accept 200 100 expect 0.001790493 0.000895247 @@ -2188,6 +2194,147 @@ expect -0.001790493 0.000895247 accept -200 -100 expect -0.001790493 -0.000895247 +------------------------------------------------------------------------------- +Test oblique aspect of the spherical form +------------------------------------------------------------------------------- +operation +proj=laea +R=1 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 45 +expect 0 0 +accept 0 0 +expect 0 -0.7654 +accept 0 90 +expect 0 0.7654 +accept 0 -45 +expect 0 -1.4142 +accept 45 45 +expect 0.5194 0.1521 + +tolerance 0.1 mm +accept 45 45 +roundtrip 100 + +# error when waaay outside the sphere +direction inverse +accept 0 10 +expect failure errno tolerance_condition + +------------------------------------------------------------------------------- +Test oblique aspect of the ellipsoidal form +------------------------------------------------------------------------------- +operation +proj=laea +ellps=GRS80 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 45 +expect 0 0 +accept 0 0 +expect 0 -4860248.8602 +accept 0 90 +expect 0 4886594.2207 +accept 0 -45 +expect 0 -8984728.0442 +accept 45 45 +expect 3318800.8682 968788.2336 + +tolerance 10 cm +accept 45 45 +roundtrip 100 + +# test rho Date: Wed, 11 Apr 2018 17:56:08 +0200 Subject: Enhance the precision of Spherical Mercator projection near the equator This uses a linear approximation of tan(x+pi/4) for better precision at small latitudes. As a result points of latitude 0 maintain a 0 Y coordinate and 0,0 is transformed to 0,0 --- src/PJ_merc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PJ_merc.c b/src/PJ_merc.c index a3e5e846..3801b828 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -8,6 +8,13 @@ PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 +static double _tan_near_fort_pi(double x) { + if (fabs(x) <= __DBL_EPSILON__) { + return 2*x + 1.0; + } + return tan(M_FORTPI + x); +} + static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */ XY xy = {0.0,0.0}; if (fabs(fabs(lp.phi) - M_HALFPI) <= EPS10) { @@ -27,7 +34,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ return xy; } xy.x = P->k0 * lp.lam; - xy.y = P->k0 * log(tan(M_FORTPI + .5 * lp.phi)); + xy.y = P->k0 * log(_tan_near_fort_pi(.5 * lp.phi)); return xy; } -- cgit v1.2.3 From 60d86d4914b816143b4145ccae0def0420f2a70d Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Wed, 11 Apr 2018 23:11:23 +0200 Subject: Update docs for nsper --- docs/source/operations/projections/nsper.rst | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3 From 38443f7545dad1d849a889921976fa94e9b76264 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Wed, 11 Apr 2018 23:11:41 +0200 Subject: Add more tests for nsper --- test/gie/builtins.gie | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) 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 -- cgit v1.2.3 From bd2e1363b021e1a1c6a4ebbc0aa55e8dc98e2587 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 12 Apr 2018 08:50:59 +0200 Subject: Fix: use proper double epsilon declaration --- src/PJ_merc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PJ_merc.c b/src/PJ_merc.c index 3801b828..2c89fbc6 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -2,6 +2,7 @@ #include "proj_internal.h" #include "proj.h" #include "projects.h" +#include PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts="; PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; @@ -9,7 +10,7 @@ PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 static double _tan_near_fort_pi(double x) { - if (fabs(x) <= __DBL_EPSILON__) { + if (fabs(x) <= DBL_EPSILON) { return 2*x + 1.0; } return tan(M_FORTPI + x); -- cgit v1.2.3 From f2b3604a94349697828baa7de63a30a97ac15b2b Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 12 Apr 2018 09:47:43 +0200 Subject: Use log1p in forward spherical mercator --- src/PJ_merc.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/PJ_merc.c b/src/PJ_merc.c index 2c89fbc6..0bf98625 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -9,11 +9,31 @@ PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 -static double _tan_near_fort_pi(double x) { +#if !defined(HAVE_C99_MATH) +#define HAVE_C99_MATH 0 +#endif + +#if HAVE_C99_MATH +#define log1px log1p +#else +static double log1px(double x) { + volatile double + y = 1 + x, + z = y - 1; + /* Here's the explanation for this magic: y = 1 + z, exactly, and z + * approx x, thus log(y)/z (which is nearly constant near z = 0) returns + * a good approximation to the true log(1 + x)/x. The multiplication x * + * (log(y)/z) introduces little additional error. */ + return z == 0 ? x : x * log(y) / z; +} +#endif + +static double logtanpfpim1(double x) { /* log(tan(x/2 + M_FORTPI)) */ if (fabs(x) <= DBL_EPSILON) { - return 2*x + 1.0; + /* tan(M_FORTPI + .5 * x) can be approximated by 1.0 + x */ + return log1px(x); } - return tan(M_FORTPI + x); + return log(tan(M_FORTPI + .5 * x)); } static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */ @@ -35,7 +55,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ return xy; } xy.x = P->k0 * lp.lam; - xy.y = P->k0 * log(_tan_near_fort_pi(.5 * lp.phi)); + xy.y = P->k0 * logtanpfpim1(lp.phi); return xy; } -- cgit v1.2.3 From 8f4c8cfe8188603ce3beee733dbf52f79c4c6b17 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 3 Apr 2018 17:02:25 +0200 Subject: Remove proj.spec file The file seem to be unused by the packagers and we don't use ourselves. Instead of trying to keep it up to date with each release we might as well get rid of the thing. --- HOWTO-RELEASE | 18 ++++++------------ proj.spec | 51 --------------------------------------------------- 2 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 proj.spec diff --git a/HOWTO-RELEASE b/HOWTO-RELEASE index 3053523b..d020d486 100644 --- a/HOWTO-RELEASE +++ b/HOWTO-RELEASE @@ -46,33 +46,27 @@ 7) Update NEWS file with summary of release changes. -8) Update the proj.spec file for the new version: - - PACKAGE_VERSION - - Source0 - - %setup line - - rm -rf line - -9) If this is a major release, prepare a branch. +8) If this is a major release, prepare a branch. git checkout -b 5.0 -10) Tag the release +9) Tag the release git tag 5.0.0 -11) Do a "make dist-all" in the proj root directory. After some grinding +10) Do a "make dist-all" in the proj root directory. After some grinding this should result in files like proj-4.4.3.tar.gz and proj-4.4.3.zip being created. These are full source distributions. -12) Put these in the proj ftp area on /osgeo/download/proj on +11) Put these in the proj ftp area on /osgeo/download/proj on download.osgeo.org. This can be done via scp using a command like the following. scp proj-4.4.3.{tar.gz,zip} warmerdam@download.osgeo.org:/osgeo/download/proj -13) Announce the new release on the PROJ.4 and MetaCRS mailing lists. +12) Announce the new release on the PROJ.4 and MetaCRS mailing lists. -14) Issue a new release report on GitHub: +13) Issue a new release report on GitHub: https://github.com/OSGeo/proj.4/releases/new diff --git a/proj.spec b/proj.spec deleted file mode 100644 index b0854077..00000000 --- a/proj.spec +++ /dev/null @@ -1,51 +0,0 @@ -%define PACKAGE_NAME proj -%define PACKAGE_VERSION 5.0.0 -%define PACKAGE_URL http://proj4.org -%define _prefix /usr - -Summary: Cartographic projection and geodetic transformation software -Name: %PACKAGE_NAME -Version: %PACKAGE_VERSION -Release: 1 -Source0: proj-5.0.0.tar.gz -License: MIT, Copyright (c) 2000, Frank Warmerdam -Group: Applications/GIS -Vendor: Intevation GmbH -Distribution: FreeGIS CD - -BuildRoot: %{_builddir}/%{name}-root -Prefix: %{_prefix} -BuildRequires: libtool -Conflicts: PROJ.4 - -%description -PROJ is a generic coordinate transformation software, that transforms -coordinates from one coordinate reference system (CRS) to another. This -includes cartographic projections as well as geodetic transformations. - -%prep -%setup -D -n proj-5.0.0 -%{_builddir}/%{name}-%{version}/autogen.sh -%configure - -%build -make - -%install -rm -rf $RPM_BUILD_ROOT -%makeinstall - -%clean -rm -rf %{_builddir}/proj-5.0.0 -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%{_libdir}/* -%{_bindir}/* -%{_includedir}/* -%{_datadir}/proj/* -%{_mandir}/man1/* -%{_mandir}/man3/* - -%doc AUTHORS COPYING ChangeLog NEWS README.md -- cgit v1.2.3 From 2915b6d6f96819c294cc4098160ef41975075b0e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 1 Apr 2018 19:50:34 +0200 Subject: Add a CITATION file (fixes #309) --- CITATION | 14 ++++++++++++++ HOWTO-RELEASE | 14 ++++++++------ Makefile.am | 2 +- README.md | 4 ++++ 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 CITATION diff --git a/CITATION b/CITATION new file mode 100644 index 00000000..82643d84 --- /dev/null +++ b/CITATION @@ -0,0 +1,14 @@ +To cite PROJ in publications use: + + PROJ contributors (2018). PROJ coordinate transformation software + library. Open Source Geospatial Foundation. URL http://proj4.org/. + +A BibTeX entry for LaTeX users is + + @Manual{, + title = {{PROJ} coordinate transformation software library}, + author = {{PROJ contributors}}, + organization = {Open Source Geospatial Foundation}, + year = {2018}, + url = {http://proj4.org/}, + } diff --git a/HOWTO-RELEASE b/HOWTO-RELEASE index d020d486..fbf99670 100644 --- a/HOWTO-RELEASE +++ b/HOWTO-RELEASE @@ -46,27 +46,29 @@ 7) Update NEWS file with summary of release changes. -8) If this is a major release, prepare a branch. +8) Update the year in CITATION + +9) If this is a major release, prepare a branch. git checkout -b 5.0 -9) Tag the release +10) Tag the release git tag 5.0.0 -10) Do a "make dist-all" in the proj root directory. After some grinding +11) Do a "make dist-all" in the proj root directory. After some grinding this should result in files like proj-4.4.3.tar.gz and proj-4.4.3.zip being created. These are full source distributions. -11) Put these in the proj ftp area on /osgeo/download/proj on +12) Put these in the proj ftp area on /osgeo/download/proj on download.osgeo.org. This can be done via scp using a command like the following. scp proj-4.4.3.{tar.gz,zip} warmerdam@download.osgeo.org:/osgeo/download/proj -12) Announce the new release on the PROJ.4 and MetaCRS mailing lists. +13) Announce the new release on the PROJ.4 and MetaCRS mailing lists. -13) Issue a new release report on GitHub: +14) Issue a new release report on GitHub: https://github.com/OSGeo/proj.4/releases/new diff --git a/Makefile.am b/Makefile.am index f4a82f9c..39a1201b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = src man nad jniwrap cmake test -EXTRA_DIST = makefile.vc nmake.opt CMakeLists.txt +EXTRA_DIST = makefile.vc nmake.opt CMakeLists.txt CITATION pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = proj.pc diff --git a/README.md b/README.md index 32e3df66..981be967 100644 --- a/README.md +++ b/README.md @@ -144,3 +144,7 @@ where PROJ will find them after installation. The default location of `PROJ_LIB` on UNIX-based systems is `/usr/local/share/proj` but it may be changed to a different directory. On Windows you have to define `PROJ_LIB` yourself. + +### Citing PROJ in publications + +See [CITATION](CITATION) -- cgit v1.2.3 From 23415f832cc74b56958f90900d8b55b356678a88 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 8 Apr 2018 17:26:55 +0200 Subject: Override style of Sphinx versionmodified directives so they stand out more clearly in the text --- docs/source/_static/theme_overrides.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/_static/theme_overrides.css b/docs/source/_static/theme_overrides.css index b82d2881..4e612939 100644 --- a/docs/source/_static/theme_overrides.css +++ b/docs/source/_static/theme_overrides.css @@ -55,3 +55,16 @@ div.math { overflow-x: auto; overflow-y: hidden; } + +/* Override style of versionmodified directives */ +.versionadded { + font-style: italic; +} + +.versionchanged { + font-style: italic; +} + +.deprecated { + font-style: italic; +} -- cgit v1.2.3 From c2d5216b02705f5b1432d91aa1e6bef7f23d0ce6 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 9 Apr 2018 02:02:26 +0200 Subject: Fix bad example in eqc docs --- docs/source/operations/projections/eqc.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/source/operations/projections/eqc.rst b/docs/source/operations/projections/eqc.rst index be431977..5833bd61 100644 --- a/docs/source/operations/projections/eqc.rst +++ b/docs/source/operations/projections/eqc.rst @@ -64,9 +64,8 @@ Example using EPSG 32662 (WGS84 Plate Carrée):: Example using Plate Carrée projection with true scale at latitude 30° and central meridian 90°W:: - $ echo -88 30 | proj +proj=eqc +lat_ts=30 +lat_0=90w - -8483684.61 13358338.90 - + $ echo -88 30 | proj +proj=eqc +lat_ts=30 +lon_0=90w + 192811.01 3339584.72 Mathematical definition ####################### -- cgit v1.2.3 From 587d454391b867f5338c91de356ad40404efcc7f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 7 Apr 2018 15:35:08 +0200 Subject: Pipeline: make sure geocentric/cartesian space transform is done with original ellipsoid parameters (before any projection mess with them) --- src/PJ_pipeline.c | 2 ++ src/proj_4D_api.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PJ_pipeline.c b/src/PJ_pipeline.c index b60e05a8..aa7d76f8 100644 --- a/src/PJ_pipeline.c +++ b/src/PJ_pipeline.c @@ -306,6 +306,8 @@ static void set_ellipsoid(PJ *P) { /* the PJ you provided". */ proj_errno_reset (P); } + P->a_orig = P->a; + P->es_orig = P->es; pj_calc_ellipsoid_params (P, P->a, P->es); diff --git a/src/proj_4D_api.c b/src/proj_4D_api.c index 11a56ac0..aed4685b 100644 --- a/src/proj_4D_api.c +++ b/src/proj_4D_api.c @@ -485,7 +485,7 @@ Returns 1 on success, 0 on failure if (0==d[0] && 0==d[1] && 0==d[2] && 0==d[3] && 0==d[4] && 0==d[5] && 0==d[6]) { /* If the current ellipsoid is not WGS84, then make sure the */ /* change in ellipsoid is still done. */ - if (!(fabs(P->a - 6378137.0) < 1e-8 && fabs(P->f - 1./ 298.257223563) < 1e-15)) { + if (!(fabs(P->a_orig - 6378137.0) < 1e-8 && fabs(P->es_orig - 0.0066943799901413) < 1e-15)) { do_cart = 1; } break; @@ -512,7 +512,7 @@ Returns 1 on success, 0 on failure /* geocentric/cartesian space or we need to do a Helmert transform. */ if (P->is_geocent || P->helmert || do_cart) { char def[150]; - sprintf (def, "break_cs2cs_recursion proj=cart a=%40.20g f=%40.20g", P->a, P->f); + sprintf (def, "break_cs2cs_recursion proj=cart a=%40.20g es=%40.20g", P->a_orig, P->es_orig); Q = proj_create (P->ctx, def); if (0==Q) return 0; -- cgit v1.2.3 From a4f4228d055aac7bb66f77b10fe5128e69e9e09a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 7 Apr 2018 13:41:12 +0200 Subject: Add webmerc projection --- docs/source/operations/projections/index.rst | 1 + docs/source/operations/projections/webmerc.rst | 78 ++++++++++++++++++++++++++ src/PJ_merc.c | 17 ++++++ src/pj_list.h | 1 + test/gie/4D-API_cs2cs-style.gie | 13 +++++ 5 files changed, 110 insertions(+) create mode 100644 docs/source/operations/projections/webmerc.rst diff --git a/docs/source/operations/projections/index.rst b/docs/source/operations/projections/index.rst index 9255d9fd..77decd6c 100644 --- a/docs/source/operations/projections/index.rst +++ b/docs/source/operations/projections/index.rst @@ -141,6 +141,7 @@ Projections map the spherical 3D space to a flat 2D space. wag5 wag6 wag7 + webmerc weren wink1 wink2 diff --git a/docs/source/operations/projections/webmerc.rst b/docs/source/operations/projections/webmerc.rst new file mode 100644 index 00000000..0c465afc --- /dev/null +++ b/docs/source/operations/projections/webmerc.rst @@ -0,0 +1,78 @@ +.. _webmerc: + +******************************************************************************** +Web Mercator / Pseudo Mercator +******************************************************************************** + +The Web Mercator / Pseudo Mercator projection is a cylindrical map projection. +This is a variant of the regular :ref:`merc` projection, except that the computation +is done on a sphere, using the semi-major axis of the ellipsoid. + +From `Wikipedia `_: + + This projection is widely used by the Web Mercator, Google Web Mercator, + Spherical Mercator, WGS 84 Web Mercator[1] or WGS 84/Pseudo-Mercator is a + variant of the Mercator projection and is the de facto standard for Web + mapping applications. [...] + It is used by virtually all major online map providers [...] + Its official EPSG identifier is EPSG:3857, although others have been used + historically. + + ++---------------------+----------------------------------------------------------+ +| **Classification** | Cylindrical (non conformant if used with ellipsoid) | ++---------------------+----------------------------------------------------------+ +| **Version** | Added in proj 5.1.0 | ++---------------------+----------------------------------------------------------+ +| **Available forms** | Forward and inverse, spherical projection | ++---------------------+----------------------------------------------------------+ +| **Defined area** | Global, but best used near the equator | ++---------------------+----------------------------------------------------------+ +| **Options** | Neither lat_0, lon_0, lat_ts or k_0 should be used. | ++---------------------+----------------------------------------------------------+ + +Usage +######## + +Example:: + + $ echo 2 49 | proj +proj=webmerc +datum=WGS84 + 222638.98 6274861.39 + +Mathematical definition +####################### + +The formulas describing the Mercator projection are all taken from G. Evenden's libproj manuals [Evenden2005]_. + +Forward projection +================== + +.. math:: + + x = \lambda + +.. math:: + + y = \ln \left[ \tan \left(\frac{\pi}{4} + \frac{\phi}{2} \right) \right] + + +Inverse projection +================== + +.. math:: + + \lambda = {x} + +.. math:: + + \phi = \frac{\pi}{2} - 2 \arctan \left[ e^{-y} \right] + + + +Further reading +############### + +#. `Wikipedia `_ + + + diff --git a/src/PJ_merc.c b/src/PJ_merc.c index 18303c45..a3e5e846 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -1,8 +1,10 @@ #define PJ_LIB__ +#include "proj_internal.h" #include "proj.h" #include "projects.h" PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts="; +PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 @@ -76,3 +78,18 @@ PJ *PROJECTION(merc) { return P; } +PJ *PROJECTION(webmerc) { + + /* Overriding k_0, lat_0 and lon_0 with fixed parameters */ + P->k0 = 1.0; + P->phi0 = 0.0; + P->lam0 = 0.0; + + P->b = P->a; + /* Clean up the ellipsoidal parameters to reflect the sphere */ + P->es = P->e = P->f = 0; + pj_calc_ellipsoid_params (P, P->a, 0); + P->inv = s_inverse; + P->fwd = s_forward; + return P; +} diff --git a/src/pj_list.h b/src/pj_list.h index 09a66034..440f7972 100644 --- a/src/pj_list.h +++ b/src/pj_list.h @@ -156,6 +156,7 @@ PROJ_HEAD(wag4, "Wagner IV") PROJ_HEAD(wag5, "Wagner V") PROJ_HEAD(wag6, "Wagner VI") PROJ_HEAD(wag7, "Wagner VII") +PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") PROJ_HEAD(weren, "Werenskiold I") PROJ_HEAD(wink1, "Winkel I") PROJ_HEAD(wink2, "Winkel II") diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie index bbd9ee39..6eed4faa 100644 --- a/test/gie/4D-API_cs2cs-style.gie +++ b/test/gie/4D-API_cs2cs-style.gie @@ -215,6 +215,19 @@ accept 487147.594520173 4934316.46263998 0 expect -10370728.80 5552839.74 0 ------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +Test that Google's Web Mercator with +proj=webmerc +------------------------------------------------------------------------------- +operation proj=pipeline step init=epsg:26915 inv step proj=webmerc datum=WGS84 +------------------------------------------------------------------------------- +tolerance 20 cm +accept 487147.594520173 4934316.46263998 +expect -10370728.80 5552839.74 + +accept 487147.594520173 4934316.46263998 0 +expect -10370728.80 5552839.74 0 +------------------------------------------------------------------------------- + ------------------------------------------------------------------------------- Test that +datum parameters are handled correctly in pipelines. See #872 for details. -- cgit v1.2.3 From 4731bc4a3438b04574545a78ac52ba631e0504c4 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 9 Apr 2018 22:27:59 +0200 Subject: Add description of projection and +lat_b parameter --- docs/source/operations/projections/airy.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/source/operations/projections/airy.rst b/docs/source/operations/projections/airy.rst index d2730592..eefda4e9 100644 --- a/docs/source/operations/projections/airy.rst +++ b/docs/source/operations/projections/airy.rst @@ -3,6 +3,11 @@ ******************************************************************************** Airy ******************************************************************************** + +The Airy projection is an azimuthal minimum error projection for the region +within the small or great circle defined by an angular distance, +:math:`\phi_b`, from the tangency point of the plane :math:`( \lambda_0, \phi_0 )`. + +---------------------+----------------------------------------------------------+ | **Classification** | | +---------------------+----------------------------------------------------------+ @@ -14,7 +19,10 @@ Airy +---------------------+----------------------------------------------------------+ | **Options** | +---------------------+----------------------------------------------------------+ -| `+lat_b` | | +| `+lat_b` | Angular distance from tangency point of the plane | +| | :math:`( \lambda_0, \phi_0 )` where the error is kept at | +| | minimum. Defaults to :math:`90^{\circ}` which is | +| | suitable for hemispherical maps. | +---------------------+----------------------------------------------------------+ | `+no_cut` | Do not cut at hemisphere limit | +---------------------+----------------------------------------------------------+ -- cgit v1.2.3 From 39477bef8714e1f489ab187a34f08d211e15cba3 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 9 Apr 2018 22:28:20 +0200 Subject: Add more test cases for airy projection --- test/gie/builtins.gie | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 4d744135..84d5c832 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -318,6 +318,74 @@ expect -189109.886908621 94583.752387504 accept -2 -1 expect -189109.886908621 -94583.752387504 +------------------------------------------------------------------------------- +Test north polar aspect +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_0=90 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 0 +expect 0 -1.3863 +accept 0 90 +expect 0 0 +accept 0 -90 +expect failure errno tolerance_condition + + +------------------------------------------------------------------------------- +Test south polar aspect +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_0=-90 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 0 +expect 0 1.3863 +accept 0 -90 +expect 0 0 +accept 0 90 +expect failure errno tolerance_condition + +------------------------------------------------------------------------------- +Test oblique aspect +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lon_0=45 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 45 45 +expect 0 0 +accept 0 0 +expext -0.7336 -0.5187 +accept -45 -45 +expect failure errno tolerance_condition + +------------------------------------------------------------------------------- +Test that coordinates on the opposing hemisphere are projected when using ++no_cut. +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_0=-90 +no_cut +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 10 +expect 0 1.5677 + + +------------------------------------------------------------------------------- +Test the +lat_b parameter +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_b=89.99999999 # check tolerance +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 0 +expect 0 0 +------------------------------------------------------------------------------- +operation +proj=airy +R=1 +lat_b=30 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 0 +expect 0 0 +accept 25 25 +expect 0.3821 0.4216 + =============================================================================== Aitoff -- cgit v1.2.3 From 6985b96c56575040e63602725be61364824b752e Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Wed, 11 Apr 2018 00:03:03 +0200 Subject: Add more tests for laea --- test/gie/builtins.gie | 151 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 149 insertions(+), 2 deletions(-) diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 84d5c832..4f6d6a44 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -2211,7 +2211,7 @@ Lambert Azimuthal Equal Area =============================================================================== ------------------------------------------------------------------------------- -operation +proj=laea +ellps=GRS80 +lat_1=0.5 +lat_2=2 +operation +proj=laea +ellps=GRS80 ------------------------------------------------------------------------------- tolerance 0.1 mm accept 2 1 @@ -2223,6 +2223,9 @@ expect -222602.471450095 110589.827224410 accept -2 -1 expect -222602.471450095 -110589.827224409 +accept 180 0 +expect failure errno tolerance_condition + direction inverse accept 200 100 expect 0.001796631 0.000904369 @@ -2234,7 +2237,7 @@ accept -200 -100 expect -0.001796631 -0.000904369 ------------------------------------------------------------------------------- -operation +proj=laea +R=6400000 +lat_1=0.5 +lat_2=2 +operation +proj=laea +R=6400000 ------------------------------------------------------------------------------- tolerance 0.1 mm accept 2 1 @@ -2246,6 +2249,9 @@ expect -223365.281370125 111716.668072916 accept -2 -1 expect -223365.281370125 -111716.668072916 +accept 180 0 +expect failure errno tolerance_condition + direction inverse accept 200 100 expect 0.001790493 0.000895247 @@ -2256,6 +2262,147 @@ expect -0.001790493 0.000895247 accept -200 -100 expect -0.001790493 -0.000895247 +------------------------------------------------------------------------------- +Test oblique aspect of the spherical form +------------------------------------------------------------------------------- +operation +proj=laea +R=1 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 45 +expect 0 0 +accept 0 0 +expect 0 -0.7654 +accept 0 90 +expect 0 0.7654 +accept 0 -45 +expect 0 -1.4142 +accept 45 45 +expect 0.5194 0.1521 + +tolerance 0.1 mm +accept 45 45 +roundtrip 100 + +# error when waaay outside the sphere +direction inverse +accept 0 10 +expect failure errno tolerance_condition + +------------------------------------------------------------------------------- +Test oblique aspect of the ellipsoidal form +------------------------------------------------------------------------------- +operation +proj=laea +ellps=GRS80 +lat_0=45 +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 0 45 +expect 0 0 +accept 0 0 +expect 0 -4860248.8602 +accept 0 90 +expect 0 4886594.2207 +accept 0 -45 +expect 0 -8984728.0442 +accept 45 45 +expect 3318800.8682 968788.2336 + +tolerance 10 cm +accept 45 45 +roundtrip 100 + +# test rho Date: Wed, 11 Apr 2018 23:11:23 +0200 Subject: Update docs for nsper --- docs/source/operations/projections/nsper.rst | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3 From 92168bc712d72d68b010c9d0495dccb0807a39bf Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Wed, 11 Apr 2018 23:11:41 +0200 Subject: Add more tests for nsper --- test/gie/builtins.gie | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) 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 -- cgit v1.2.3 From 647637f81247d341b8865d5d0eda1cad3c8cec8a Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Wed, 11 Apr 2018 17:56:08 +0200 Subject: Enhance the precision of Spherical Mercator projection near the equator This uses a linear approximation of tan(x+pi/4) for better precision at small latitudes. As a result points of latitude 0 maintain a 0 Y coordinate and 0,0 is transformed to 0,0 --- src/PJ_merc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PJ_merc.c b/src/PJ_merc.c index a3e5e846..3801b828 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -8,6 +8,13 @@ PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 +static double _tan_near_fort_pi(double x) { + if (fabs(x) <= __DBL_EPSILON__) { + return 2*x + 1.0; + } + return tan(M_FORTPI + x); +} + static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */ XY xy = {0.0,0.0}; if (fabs(fabs(lp.phi) - M_HALFPI) <= EPS10) { @@ -27,7 +34,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ return xy; } xy.x = P->k0 * lp.lam; - xy.y = P->k0 * log(tan(M_FORTPI + .5 * lp.phi)); + xy.y = P->k0 * log(_tan_near_fort_pi(.5 * lp.phi)); return xy; } -- cgit v1.2.3 From 74030eb65a21e43b08b32239e5ec7bb92b30eb77 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 12 Apr 2018 08:50:59 +0200 Subject: Fix: use proper double epsilon declaration --- src/PJ_merc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PJ_merc.c b/src/PJ_merc.c index 3801b828..2c89fbc6 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -2,6 +2,7 @@ #include "proj_internal.h" #include "proj.h" #include "projects.h" +#include PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts="; PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; @@ -9,7 +10,7 @@ PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 static double _tan_near_fort_pi(double x) { - if (fabs(x) <= __DBL_EPSILON__) { + if (fabs(x) <= DBL_EPSILON) { return 2*x + 1.0; } return tan(M_FORTPI + x); -- cgit v1.2.3 From 60c709f19a5a582c5f3f6ee53af9fee2ddb7fe50 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 12 Apr 2018 09:47:43 +0200 Subject: Use log1p in forward spherical mercator --- src/PJ_merc.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/PJ_merc.c b/src/PJ_merc.c index 2c89fbc6..0bf98625 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -9,11 +9,31 @@ PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 -static double _tan_near_fort_pi(double x) { +#if !defined(HAVE_C99_MATH) +#define HAVE_C99_MATH 0 +#endif + +#if HAVE_C99_MATH +#define log1px log1p +#else +static double log1px(double x) { + volatile double + y = 1 + x, + z = y - 1; + /* Here's the explanation for this magic: y = 1 + z, exactly, and z + * approx x, thus log(y)/z (which is nearly constant near z = 0) returns + * a good approximation to the true log(1 + x)/x. The multiplication x * + * (log(y)/z) introduces little additional error. */ + return z == 0 ? x : x * log(y) / z; +} +#endif + +static double logtanpfpim1(double x) { /* log(tan(x/2 + M_FORTPI)) */ if (fabs(x) <= DBL_EPSILON) { - return 2*x + 1.0; + /* tan(M_FORTPI + .5 * x) can be approximated by 1.0 + x */ + return log1px(x); } - return tan(M_FORTPI + x); + return log(tan(M_FORTPI + .5 * x)); } static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */ @@ -35,7 +55,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ return xy; } xy.x = P->k0 * lp.lam; - xy.y = P->k0 * log(_tan_near_fort_pi(.5 * lp.phi)); + xy.y = P->k0 * logtanpfpim1(lp.phi); return xy; } -- cgit v1.2.3 From f9d81882c473310e5a1785bdbee06d8658998051 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 3 Apr 2018 17:45:23 +0200 Subject: Add --skip-lines option to cct With this it is possible to skip the header when transforming coordinates from a file. --- docs/source/apps/cct.rst | 7 +++++++ src/cct.c | 24 ++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/docs/source/apps/cct.rst b/docs/source/apps/cct.rst index dc2944f2..20aec06c 100644 --- a/docs/source/apps/cct.rst +++ b/docs/source/apps/cct.rst @@ -44,6 +44,13 @@ The following control parameters can appear in any order: Specify a fixed observation height to be used for all input data. +.. option:: s , --skip-lines= + + .. versionadded:: 5.1.0 + + Skip the first *n* lines of input. This applies to any kind of input, wether + it comes from ``STDIN``, a file or interactive user input. + .. option:: -v, --verbose Write non-essential, but potentially useful, information to stderr. diff --git a/src/cct.c b/src/cct.c index 6b8f35f3..2952f2b7 100644 --- a/src/cct.c +++ b/src/cct.c @@ -105,6 +105,7 @@ static const char usage[] = { " -z value Provide a fixed z value for all input data (e.g. -z 0)\n" " -t value Provide a fixed t value for all input data (e.g. -t 0)\n" " -I Do the inverse transformation\n" + " -s n Skip n first lines of a infile\n" " -v Verbose: Provide non-essential informational output.\n" " Repeat -v for more verbosity (e.g. -vv)\n" "--------------------------------------------------------------------------------\n" @@ -116,6 +117,7 @@ static const char usage[] = { " --time Alias for -t\n" " --verbose Alias for -v\n" " --inverse Alias for -I\n" + " --skip-lines Alias for -s\n" " --help Alias for -h\n" " --version Print version number\n" "--------------------------------------------------------------------------------\n" @@ -156,13 +158,19 @@ int main(int argc, char **argv) { OPTARGS *o; FILE *fout = stdout; char *buf; - int nfields = 4, direction = 1, verbose; + int nfields = 4, direction = 1, skip_lines = 0, verbose; double fixed_z = HUGE_VAL, fixed_time = HUGE_VAL; int columns_xyzt[] = {1, 2, 3, 4}; const char *longflags[] = {"v=verbose", "h=help", "I=inverse", "version", 0}; - const char *longkeys[] = {"o=output", "c=columns", "z=height", "t=time", 0}; - - o = opt_parse (argc, argv, "hvI", "cozt", longflags, longkeys); + const char *longkeys[] = { + "o=output", + "c=columns", + "z=height", + "t=time", + "s=skip-lines", + 0}; + + o = opt_parse (argc, argv, "hvI", "cozts", longflags, longkeys); if (0==o) return 0; @@ -202,6 +210,10 @@ int main(int argc, char **argv) { nfields--; } + if (opt_given (o, "s")) { + skip_lines = atoi (opt_arg(o, "s")); + } + if (opt_given (o, "c")) { /* cppcheck-suppress invalidscanf */ int ncols = sscanf (opt_arg (o, "c"), "%d,%d,%d,%d", columns_xyzt, columns_xyzt+1, columns_xyzt+2, columns_xyzt+3); @@ -265,6 +277,10 @@ int main(int argc, char **argv) { continue; } point = parse_input_line (buf, columns_xyzt, fixed_z, fixed_time); + if (skip_lines > 0) { + skip_lines--; + continue; + } if (HUGE_VAL==point.xyzt.x) { char *c = column (buf, 1); -- cgit v1.2.3 From 2f082b70cbdafdea49bb123e027406089e7ad65b Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Thu, 5 Apr 2018 19:25:31 +0000 Subject: Move logging functions to proj.h API --- docs/source/development/reference/datatypes.rst | 50 +++++++++++++++++++++++++ docs/source/development/reference/functions.rst | 28 ++++++++++++++ src/pj_internal.c | 9 +---- src/proj.h | 15 +++++++- src/proj_internal.h | 16 -------- 5 files changed, 94 insertions(+), 24 deletions(-) diff --git a/docs/source/development/reference/datatypes.rst b/docs/source/development/reference/datatypes.rst index 8966923a..2a335a15 100644 --- a/docs/source/development/reference/datatypes.rst +++ b/docs/source/development/reference/datatypes.rst @@ -744,3 +744,53 @@ Info structures .. c:member:: char PJ_INIT_INFO.lastupdate Date of last update of the init-file. + + +Logging +------------------------------------------------------------------------------- + +.. c:type:: PJ_LOG_LEVEL + + Enum of logging levels in PROJ. Used to set the logging level in PROJ. + Usually using :c:func:`proj_log_level`. + + .. c:member:: PJ_LOG_NONE + + Don't log anything. + + .. c:member:: PJ_LOG_ERROR + + Log only errors. + + .. c:member:: PJ_LOG_DEBUG + + Log errors and additional debug information. + + .. c:member:: PJ_LOG_TRACE + + Highest logging level. Log everything including very detailed debug + information. + + .. c:member:: PJ_LOG_TELL + + Special logging level that when used in :c:func:`proj_log_level` + will return the current logging level set in PROJ. + + .. versionadded:: 5.1.0 + +.. c:type:: PJ_LOG_FUNC + + Function prototype for the logging function used by PROJ. + Defined as + + .. code-block:: C + + typedef void (*PJ_LOG_FUNCTION)(void *, int, const char *); + + where the :c:type:`void` pointer references a data structure used by the + calling application, the :c:type:`int` is used to set the logging level + and the :c:type:`const char` pointer is the string that will be logged + by the function. + + + .. versionadded:: 5.1.0 diff --git a/docs/source/development/reference/functions.rst b/docs/source/development/reference/functions.rst index 3d141ae2..52f801e5 100644 --- a/docs/source/development/reference/functions.rst +++ b/docs/source/development/reference/functions.rst @@ -276,6 +276,34 @@ Change the error-state of :c:data:`P` to `err`. .. note:: Available from version 5.1.0. + +Logging +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. c:function:: PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL level) + + Get and set logging level for a given context. Changes the log level to + :c:data:`level` and returns the previous logging level. If called with + :c:data:`level` set to :c:type:`PJ_LOG_TELL` the function returns the current + logging level without changing it. + + :param PJ_CONTEXT* ctx: Threading context. + :param PJ_LOG_LEVEL level: New logging level. + + :returns: :c:type:`PJ_LOG_LEVEL` + + .. versionadded:: 5.1.0 + +.. c:function:: void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf) + + Override the internal log function of PROJ. + + :param PJ_CONTEXT* ctx: Threading context. + :param void* app_data: Pointer to data structure used by the calling application. + :param PJ_LOG_FUNCTION logf: Log function that overrides the PROJ log function. + + .. versionadded:: 5.1.0 + Info functions ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/pj_internal.c b/src/pj_internal.c index 4da47051..891e0b9f 100644 --- a/src/pj_internal.c +++ b/src/pj_internal.c @@ -364,11 +364,6 @@ to that context. return; } - - - - - /* logging */ /* pj_vlog resides in pj_log.c and relates to pj_log as vsprintf relates to sprintf */ @@ -376,11 +371,11 @@ void pj_vlog( projCtx ctx, int level, const char *fmt, va_list args ); /***************************************************************************************/ -enum proj_log_level proj_log_level (PJ_CONTEXT *ctx, enum proj_log_level log_level) { +PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL log_level) { /**************************************************************************************** Set logging level 0-3. Higher number means more debug info. 0 turns it off ****************************************************************************************/ - enum proj_log_level previous; + PJ_LOG_LEVEL previous; if (0==ctx) ctx = pj_get_default_ctx(); if (0==ctx) diff --git a/src/proj.h b/src/proj.h index 7bc9b10e..3d64ed1a 100644 --- a/src/proj.h +++ b/src/proj.h @@ -268,6 +268,17 @@ struct PJ_INIT_INFO { char lastupdate[16]; /* Date of last update in YYYY-MM-DD format */ }; +typedef enum PJ_LOG_LEVEL { + PJ_LOG_NONE = 0, + PJ_LOG_ERROR = 1, + PJ_LOG_DEBUG = 2, + PJ_LOG_TRACE = 3, + PJ_LOG_TELL = 4, + PJ_LOG_DEBUG_MAJOR = 2, /* for proj_api.h compatibility */ + PJ_LOG_DEBUG_MINOR = 3 /* for proj_api.h compatibility */ +} PJ_LOG_LEVEL; + +typedef void (*PJ_LOG_FUNCTION)(void *, int, const char *); /* The context type - properly namespaced synonym for projCtx */ @@ -342,7 +353,6 @@ double proj_xyz_dist (PJ_COORD a, PJ_COORD b); PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b); - /* Set or read error level */ int proj_context_errno (PJ_CONTEXT *ctx); int proj_errno (const PJ *P); @@ -351,6 +361,9 @@ int proj_errno_reset (const PJ *P); int proj_errno_restore (const PJ *P, int err); const char* proj_errno_string (int err); +PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL level); +void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf); + /* Scaling and angular distortion factors */ PJ_FACTORS proj_factors(PJ *P, PJ_COORD lp); diff --git a/src/proj_internal.h b/src/proj_internal.h index 3f6ccde0..1aca9201 100644 --- a/src/proj_internal.h +++ b/src/proj_internal.h @@ -97,25 +97,9 @@ double proj_vgrid_value(PJ *P, PJ_LP lp); PJ_LP proj_hgrid_value(PJ *P, PJ_LP lp); PJ_LP proj_hgrid_apply(PJ *P, PJ_LP lp, PJ_DIRECTION direction); -/* High level functionality for handling thread contexts */ -enum proj_log_level { - PJ_LOG_NONE = 0, - PJ_LOG_ERROR = 1, - PJ_LOG_DEBUG = 2, - PJ_LOG_TRACE = 3, - PJ_LOG_TELL = 4, - PJ_LOG_DEBUG_MAJOR = 2, /* for proj_api.h compatibility */ - PJ_LOG_DEBUG_MINOR = 3 /* for proj_api.h compatibility */ -}; - -/* Set logging level 0-3. Higher number means more debug info. 0 turns it off */ -enum proj_log_level proj_log_level (PJ_CONTEXT *ctx, enum proj_log_level log_level); -typedef void (*PJ_LOG_FUNCTION)(void *, int, const char *); - void proj_log_error (PJ *P, const char *fmt, ...); void proj_log_debug (PJ *P, const char *fmt, ...); void proj_log_trace (PJ *P, const char *fmt, ...); -void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf); int pj_ellipsoid (PJ *); void pj_inherit_ellipsoid_def (const PJ *src, PJ *dst); -- cgit v1.2.3 From c3e346b7b61bd18b30de9f09ad0b1b507210ef5f Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Thu, 5 Apr 2018 19:26:07 +0000 Subject: Use PROJ logging facility in cct --- src/cct.c | 98 +++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 27 deletions(-) diff --git a/src/cct.c b/src/cct.c index 2952f2b7..c3d94ed2 100644 --- a/src/cct.c +++ b/src/cct.c @@ -76,6 +76,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2016-05-25/2017-10-26 #include #include #include +#include #include "proj.h" #include "proj_internal.h" @@ -86,13 +87,14 @@ Thomas Knudsen, thokn@sdfe.dk, 2016-05-25/2017-10-26 /* Prototypes for functions in proj_strtod.c */ double proj_strtod(const char *str, char **endptr); double proj_atof(const char *str); +static void logger(void *data, int level, const char *msg); +static void print(PJ_LOG_LEVEL verbosity, const char *fmt, ...); /* Prototypes from functions in this file */ char *column (char *buf, int n); PJ_COORD parse_input_line (char *buf, int *columns, double fixed_height, double fixed_time); - static const char usage[] = { "--------------------------------------------------------------------------------\n" "Usage: %s [-options]... [+operator_specs]... infile...\n" @@ -151,12 +153,57 @@ static const char usage[] = { "--------------------------------------------------------------------------------\n" }; + +static void logger(void *data, int level, const char *msg) { + FILE *stream; + int log_tell = proj_log_level(PJ_DEFAULT_CTX, PJ_LOG_TELL); + + stream = (FILE *) data; + + /* if we use PJ_LOG_NONE we always want to print stuff to stream */ + if (level == PJ_LOG_NONE) { + fprintf(stream, "%s", msg); + return; + } + + /* should always print to stderr if level == PJ_LOG_ERROR */ + if (level == PJ_LOG_ERROR) { + fprintf(stderr, "%s", msg); + return; + } + + /* otherwise only print if log level set by user is high enough */ + if (level <= log_tell) + fprintf(stream, "%s", msg); +} + +FILE *fout; + +static void print(PJ_LOG_LEVEL log_level, const char *fmt, ...) { + + va_list args; + char *msg_buf; + + va_start( args, fmt ); + + msg_buf = (char *) malloc(100000); + if( msg_buf == NULL ) + return; + + vsprintf( msg_buf, fmt, args ); + + logger((void *) fout, log_level, msg_buf); + + va_end( args ); + free( msg_buf ); +} + + int main(int argc, char **argv) { PJ *P; PJ_COORD point; PJ_PROJ_INFO info; OPTARGS *o; - FILE *fout = stdout; char *buf; int nfields = 4, direction = 1, skip_lines = 0, verbose; double fixed_z = HUGE_VAL, fixed_time = HUGE_VAL; @@ -179,26 +226,26 @@ int main(int argc, char **argv) { return 0; } - direction = opt_given (o, "I")? -1: 1; - verbose = opt_given (o, "v"); + + verbose = MIN(opt_given (o, "v"), 3); /* log level can't be larger than 3 */ + proj_log_level (PJ_DEFAULT_CTX, verbose); + proj_log_func (PJ_DEFAULT_CTX, (void *) fout, logger); if (opt_given (o, "version")) { - fprintf (stdout, "%s: %s\n", o->progname, pj_get_release ()); + print (PJ_LOG_NONE, "%s: %s\n", o->progname, pj_get_release ()); return 0; } if (opt_given (o, "o")) fout = fopen (opt_arg (o, "output"), "wt"); if (0==fout) { - fprintf (stderr, "%s: Cannot open '%s' for output\n", o->progname, opt_arg (o, "output")); + print (PJ_LOG_ERROR, "%s: Cannot open '%s' for output\n", o->progname, opt_arg (o, "output")); free (o); return 1; } - if (verbose > 3) - fprintf (fout, "%s: Running in very verbose mode\n", o->progname); - + print (PJ_LOG_TRACE, "%s: Running in very verbose mode\n", o->progname); if (opt_given (o, "z")) { fixed_z = proj_atof (opt_arg (o, "z")); @@ -218,7 +265,7 @@ int main(int argc, char **argv) { /* cppcheck-suppress invalidscanf */ int ncols = sscanf (opt_arg (o, "c"), "%d,%d,%d,%d", columns_xyzt, columns_xyzt+1, columns_xyzt+2, columns_xyzt+3); if (ncols != nfields) { - fprintf (stderr, "%s: Too few input columns given: '%s'\n", o->progname, opt_arg (o, "c")); + print (PJ_LOG_ERROR, "%s: Too few input columns given: '%s'\n", o->progname, opt_arg (o, "c")); free (o); if (stdout != fout) fclose (fout); @@ -229,7 +276,7 @@ int main(int argc, char **argv) { /* Setup transformation */ P = proj_create_argv (0, o->pargc, o->pargv); if ((0==P) || (0==o->pargc)) { - fprintf (stderr, "%s: Bad transformation arguments - (%s)\n '%s -h' for help\n", + print (PJ_LOG_ERROR, "%s: Bad transformation arguments - (%s)\n '%s -h' for help\n", o->progname, pj_strerrno (proj_errno(P)), o->progname); free (o); if (stdout != fout) @@ -237,15 +284,13 @@ int main(int argc, char **argv) { return 1; } - if (verbose > 4) { - info = proj_pj_info (P); - fprintf (stdout, "Final: %s argc=%d pargc=%d\n", info.definition, argc, o->pargc); - } + info = proj_pj_info (P); + print (PJ_LOG_TRACE, "Final: %s argc=%d pargc=%d\n", info.definition, argc, o->pargc); if (direction==-1) { /* fail if an inverse operation is not available */ - if (!proj_pj_info(P).has_inverse) { - fprintf (stderr, "Inverse operation not available\n"); + if (!info.has_inverse) { + print (PJ_LOG_ERROR, "Inverse operation not available\n"); if (stdout != fout) fclose (fout); return 1; @@ -258,7 +303,7 @@ int main(int argc, char **argv) { /* Allocate input buffer */ buf = calloc (1, 10000); if (0==buf) { - fprintf (stderr, "%s: Out of memory\n", o->progname); + print (PJ_LOG_ERROR, "%s: Out of memory\n", o->progname); pj_free (P); free (o); if (stdout != fout) @@ -273,7 +318,7 @@ int main(int argc, char **argv) { void *ret = fgets (buf, 10000, o->input); opt_eof_handler (o); if (0==ret) { - fprintf (stderr, "Read error in record %d\n", (int) o->record_index); + print (PJ_LOG_ERROR, "Read error in record %d\n", (int) o->record_index); continue; } point = parse_input_line (buf, columns_xyzt, fixed_z, fixed_time); @@ -286,14 +331,13 @@ int main(int argc, char **argv) { /* if it's a comment or blank line, we reflect it */ if (c && ((*c=='\0') || (*c=='#'))) { - fprintf (fout, "%s\n", buf); + print (PJ_LOG_NONE, "%s\n", buf); continue; } /* otherwise, it must be a syntax error */ - fprintf (fout, "# Record %d UNREADABLE: %s", (int) o->record_index, buf); - if (verbose) - fprintf (stderr, "%s: Could not parse file '%s' line %d\n", o->progname, opt_filename (o), opt_record (o)); + print (PJ_LOG_NONE, "# Record %d UNREADABLE: %s", (int) o->record_index, buf); + print (PJ_LOG_ERROR, "%s: Could not parse file '%s' line %d\n", o->progname, opt_filename (o), opt_record (o)); continue; } @@ -306,8 +350,8 @@ int main(int argc, char **argv) { if (HUGE_VAL==point.xyzt.x) { /* transformation error */ - fprintf (fout, "# Record %d TRANSFORMATION ERROR: %s (%s)", - (int) o->record_index, buf, pj_strerrno (proj_errno(P))); + print (PJ_LOG_NONE, "# Record %d TRANSFORMATION ERROR: %s (%s)", + (int) o->record_index, buf, pj_strerrno (proj_errno(P))); proj_errno_restore (P, err); continue; } @@ -317,10 +361,10 @@ int main(int argc, char **argv) { if (proj_angular_output (P, direction)) { point.lpzt.lam = proj_todeg (point.lpzt.lam); point.lpzt.phi = proj_todeg (point.lpzt.phi); - fprintf (fout, "%14.10f %14.10f %12.4f %12.4f\n", point.xyzt.x, point.xyzt.y, point.xyzt.z, point.xyzt.t); + print (PJ_LOG_NONE, "%14.10f %14.10f %12.4f %12.4f\n", point.xyzt.x, point.xyzt.y, point.xyzt.z, point.xyzt.t); } else - fprintf (fout, "%13.4f %13.4f %12.4f %12.4f\n", point.xyzt.x, point.xyzt.y, point.xyzt.z, point.xyzt.t); + print (PJ_LOG_NONE, "%13.4f %13.4f %12.4f %12.4f\n", point.xyzt.x, point.xyzt.y, point.xyzt.z, point.xyzt.t); } if (stdout != fout) -- cgit v1.2.3 From be27d12a028d07ed656080004c949c0da7a6012e Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Fri, 13 Apr 2018 18:11:29 +0200 Subject: Always ignore out-commented lines in cct Previous to this commit cct would return the following $ cct -c 2,3,4 -t 0 -I +proj=cart +ellps=GRS80 BLAH 3579685.56545 508396.50343 5236837.50646 8.0832413787 55.5578176654 99.9833 0.0000 8.0832413787 55.5578176654 99.9833 0.0000 where the second input should not be parsed as a valid coordinate. With this commit that no longer happens and the input is returned verbatim back to the user. Closes #932 --- src/cct.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cct.c b/src/cct.c index 2952f2b7..00fc2127 100644 --- a/src/cct.c +++ b/src/cct.c @@ -271,6 +271,7 @@ int main(int argc, char **argv) { while (opt_input_loop (o, optargs_file_format_text)) { int err; void *ret = fgets (buf, 10000, o->input); + char *c = column (buf, 1); opt_eof_handler (o); if (0==ret) { fprintf (stderr, "Read error in record %d\n", (int) o->record_index); @@ -281,15 +282,14 @@ int main(int argc, char **argv) { skip_lines--; continue; } - if (HUGE_VAL==point.xyzt.x) { - char *c = column (buf, 1); - /* if it's a comment or blank line, we reflect it */ - if (c && ((*c=='\0') || (*c=='#'))) { - fprintf (fout, "%s\n", buf); - continue; - } + /* if it's a comment or blank line, we reflect it */ + if (c && ((*c=='\0') || (*c=='#'))) { + fprintf (fout, "%s", buf); + continue; + } + if (HUGE_VAL==point.xyzt.x) { /* otherwise, it must be a syntax error */ fprintf (fout, "# Record %d UNREADABLE: %s", (int) o->record_index, buf); if (verbose) -- cgit v1.2.3 From 299135153e33869157ecd432dd0194743e959170 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Fri, 13 Apr 2018 22:42:54 +0200 Subject: Fix segfault in deformation When transforming coordinates outside the grid model the deformation operation failed spectatularly. This is now fixed by checking that the coordinate is inside the grid. If it isn't an error is returned and a debugging log message is issued. Closes #934 --- src/PJ_deformation.c | 7 +++++++ src/pj_apply_gridshift.c | 7 ++++++- test/gie/deformation.gie | 8 ++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/PJ_deformation.c b/src/PJ_deformation.c index d6376e40..58c0e4df 100644 --- a/src/PJ_deformation.c +++ b/src/PJ_deformation.c @@ -82,6 +82,7 @@ static XYZ get_grid_shift(PJ* P, XYZ cartesian) { ********************************************************************************/ PJ_COORD geodetic, shift, temp; double sp, cp, sl, cl; + int previous_errno = proj_errno_reset(P); /* cartesian to geodetic */ geodetic.lpz = pj_inv3d(cartesian, P->opaque->cart); @@ -90,6 +91,10 @@ static XYZ get_grid_shift(PJ* P, XYZ cartesian) { shift.lp = proj_hgrid_value(P, geodetic.lp); shift.enu.u = proj_vgrid_value(P, geodetic.lp); + if (proj_errno(P) == PJD_ERR_GRID_AREA) + proj_log_debug(P, "deformation: coordinate (%.3f, %.3f) outside deformation model", + proj_todeg(geodetic.lp.lam), proj_todeg(geodetic.lp.phi)); + /* grid values are stored as mm/yr, we need m/yr */ shift.xyz.x /= 1000; shift.xyz.y /= 1000; @@ -108,6 +113,8 @@ static XYZ get_grid_shift(PJ* P, XYZ cartesian) { shift.xyz = temp.xyz; + proj_errno_restore(P, previous_errno); + return shift.xyz; } diff --git a/src/pj_apply_gridshift.c b/src/pj_apply_gridshift.c index c503ec0b..1ef39b20 100644 --- a/src/pj_apply_gridshift.c +++ b/src/pj_apply_gridshift.c @@ -306,13 +306,18 @@ int proj_hgrid_init(PJ* P, const char *grids) { /********************************************/ LP proj_hgrid_value(PJ *P, LP lp) { struct CTABLE *ct; - LP out; + LP out = proj_coord_error().lp; ct = find_ctable(P->ctx, lp, P->gridlist_count, P->gridlist); + if (ct == 0) { + pj_ctx_set_errno( P->ctx, PJD_ERR_GRID_AREA); + return out; + } /* normalize input to ll origin */ lp.lam -= ct->ll.lam; lp.phi -= ct->ll.phi; + lp.lam = adjlon(lp.lam - M_PI) + M_PI; out = nad_intr(lp, ct); diff --git a/test/gie/deformation.gie b/test/gie/deformation.gie index 55283b84..b6ca3e0f 100644 --- a/test/gie/deformation.gie +++ b/test/gie/deformation.gie @@ -23,6 +23,14 @@ accept -3004295.5882503074 -1093474.1690603832 5500477.1338251457 expect -3004295.7025 -1093474.2106 5500477.3444 roundtrip 5 +# Test that errors are reported for coordinates outside the grid. +# Here we test 120W 40N which is well outside the alaska grid. +accept -2446353.8001 -4237209.0750 4077985.572 +expect failure errno grid_area +accept -2446353.8001 -4237209.0750 4077985.572 2000 +expect failure errno grid_area + + ------------------------------------------------------------------------------- Test using both horizontal and vertical grids ------------------------------------------------------------------------------- -- cgit v1.2.3 From 837e1ecf6189e64326c5dc336bd9898f1d195468 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sat, 14 Apr 2018 12:41:30 +0200 Subject: Dont do false easting/northing on cartesian coords False easting and northing should only be applied to projected coordinates (PJ_IO_UNITS_PROJECTED). This commit removes the option of false easting/northing on operations suchs as helmert and deformation that both work on cartesian coordinates. --- src/pj_fwd.c | 3 --- src/pj_inv.c | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/pj_fwd.c b/src/pj_fwd.c index 2a064e58..347f8334 100644 --- a/src/pj_fwd.c +++ b/src/pj_fwd.c @@ -112,9 +112,6 @@ static PJ_COORD fwd_finalize (PJ *P, PJ_COORD coo) { coo = proj_trans (P->cart, PJ_FWD, coo); } - coo.xyz.x = P->fr_meter * (coo.xyz.x + P->x0); - coo.xyz.y = P->fr_meter * (coo.xyz.y + P->y0); - coo.xyz.z = P->fr_meter * (coo.xyz.z + P->z0); break; /* Classic proj.4 functions return plane coordinates in units of the semimajor axis */ diff --git a/src/pj_inv.c b/src/pj_inv.c index f66fd7d1..327fef9f 100644 --- a/src/pj_inv.c +++ b/src/pj_inv.c @@ -98,10 +98,6 @@ static PJ_COORD inv_prepare (PJ *P, PJ_COORD coo) { /* de-scale and de-offset */ case PJ_IO_UNITS_CARTESIAN: - coo.xyz.x = P->to_meter * coo.xyz.x - P->x0; - coo.xyz.y = P->to_meter * coo.xyz.y - P->y0; - coo.xyz.z = P->to_meter * coo.xyz.z - P->z0; - if (P->is_geocent) coo = proj_trans (P->cart, PJ_INV, coo); -- cgit v1.2.3 From 111ce96fcadd9bd700c7000d6f22fea60211d8c7 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 15 Apr 2018 18:35:38 +0200 Subject: Update +proj=aeqd +guam test case with data from EPSG Note 7-2 --- test/gie/builtins.gie | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index fb8a53c3..63e56967 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -124,30 +124,20 @@ expect 3_860_398.3783 5_430_089.0490 roundtrip 100 ------------------------------------------------------------------------------- -Test equatorial aspect of the ellipsoidal azimuthal equidistant. Test data from -Snyder pp. 196-197, table 30. +# Test the azimuthal equidistant modified for Guam. Test data from the EPSG +Guidance Note 7 part 2, September 2016, p. 85 ------------------------------------------------------------------------------- -operation +proj=aeqd +ellps=GRS80 +guam +operation +proj=aeqd +guam +ellps=clrk66 +x_0=50000.00 +y_0=50000.00 + +lon_0=144.74875069444445 +lat_0=13.47246633333333 ------------------------------------------------------------------------------- -tolerance 1 m -accept 0 0 -expect 0.0000 0.0000 -roundtrip 100 -accept 90 90 -except 0.0000 10_001_965.7292 -roundtrip 100 -accept 0 90 -expect 0.0000 10_001_965.7292 -roundtrip 100 -accept 90 90 -expect 0.0000 10_001_965.7292 -roundtrip 100 -accept 45 45 -expect 3548107.5793 5970183.542 -#roundtrip 100 -accept -45 -45 -expect -3548107.5793 -5970183.542 -#roundtrip 100 +tolerance 1 cm +accept 144.635331291666660 13.33903846111111 +expect 37712.48 35242.00 +roundtrip 100 + +direction inverse +accept 37712.48 35242.00 +expect 144.635331291666660 13.33903846111111 ------------------------------------------------------------------------------- Test northern polar aspect of the ellipsoidal azimuthal equidistant. Test data -- cgit v1.2.3 From b0fa1a508d4827032f81ae03d29a54e3091ae47b Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 15 Apr 2018 18:41:48 +0200 Subject: Update aeqd docs with note of area of use for +guam option --- docs/source/operations/projections/aeqd.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/operations/projections/aeqd.rst b/docs/source/operations/projections/aeqd.rst index 32165e49..d4baa8b6 100644 --- a/docs/source/operations/projections/aeqd.rst +++ b/docs/source/operations/projections/aeqd.rst @@ -12,7 +12,10 @@ Azimuthal Equidistant +---------------------+----------------------------------------------------------+ | **Options** | +---------------------+----------------------------------------------------------+ -| `+guam` | Use Guam elliptical formulas. Defaults to false. | +| `+guam` | Use Guam elliptical formulas. Only accurate near the | +| | Island of Guam (:math:`\lambda\approx 144.5^{\circ}`, | +| | :math:`\phi\approx 13.5^{\circ}`) | +| | Defaults to false. | +---------------------+----------------------------------------------------------+ -- cgit v1.2.3 From adce503f6597d7cf6921f31bfa2c66db0c07f319 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 16 Apr 2018 13:22:19 +0200 Subject: Silence complaints about missing tag --- src/gie.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gie.c b/src/gie.c index 8c735b88..3831a8f1 100644 --- a/src/gie.c +++ b/src/gie.c @@ -964,6 +964,7 @@ Indicate that the remaining material should be skipped. Mostly for debugging. ******************************************************************************/ T.skip = 1; (void) args; + F->level = 2; /* Silence complaints about missing element */ return 0; } -- cgit v1.2.3 From 327a8f8b5a850167901a92747767e14ffe77c03b Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sat, 14 Apr 2018 16:47:53 +0200 Subject: Collect custom C99 math functions in proj_math.h We are relying more and more on C99 math functions. On C89 systems where those functions are not available our own custom versions of those functions are used instead. So far these has been spread across the code base. This commit gathers them in the same file and introduces the proj_math.h header. The build system checks for C99 math functions. If not found the proj_math.h header make sure that C99 functions are defined as their pj_ equivalent. Ideally proj_math.h is included instead of math.h. This removes the need for any checks against HAVE_C99_MATH in the code making it easier to read. For this commit the functions hypot, log1p and asinh has been taken care of. --- CMakeLists.txt | 3 ++- configure.ac | 3 ++- src/Makefile.am | 4 ++-- src/PJ_aea.c | 2 ++ src/PJ_aeqd.c | 1 + src/PJ_bipc.c | 1 + src/PJ_bonne.c | 2 ++ src/PJ_cart.c | 2 +- src/PJ_ccon.c | 1 + src/PJ_deformation.c | 1 + src/PJ_eqdc.c | 1 + src/PJ_geos.c | 1 + src/PJ_gnom.c | 1 + src/PJ_laea.c | 1 + src/PJ_lcc.c | 1 + src/PJ_merc.c | 23 ++---------------- src/PJ_mod_ster.c | 1 + src/PJ_nsper.c | 1 + src/PJ_oea.c | 1 + src/PJ_ortho.c | 1 + src/PJ_sconics.c | 1 + src/PJ_stere.c | 1 + src/PJ_sterea.c | 1 + src/PJ_tpeqd.c | 1 + src/gie.c | 1 + src/hypot.c | 36 ---------------------------- src/lib_proj.cmake | 2 ++ src/makefile.vc | 2 +- src/nad_cvt.c | 1 + src/pj_factors.c | 1 + src/pj_init.c | 1 + src/pj_math.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/proj_4D_api.c | 1 + src/proj_etmerc.c | 29 ++--------------------- src/proj_math.h | 53 +++++++++++++++++++++++++++++++++++++++++ src/projects.h | 5 ---- 36 files changed, 159 insertions(+), 95 deletions(-) delete mode 100644 src/hypot.c create mode 100644 src/pj_math.c create mode 100644 src/proj_math.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a02d247..f138d686 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,8 @@ int main() { int q; return (int)(hypot(3.0, 4.0) + atanh(0.8) + cbrt(8.0) + remquo(100.0, 90.0, &q) + - remainder(100.0, 90.0) + copysign(1.0, -0.0)) + + remainder(100.0, 90.0) + copysign(1.0, -0.0) + + log1p(0.1) + asinh(0.1)) + isnan(0.0); }\n" C99_MATH) if (C99_MATH) diff --git a/configure.ac b/configure.ac index 269225a5..e89961eb 100644 --- a/configure.ac +++ b/configure.ac @@ -45,7 +45,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM( [int q; return (int)(hypot(3.0, 4.0) + atanh(0.8) + cbrt(8.0) + remquo(100.0, 90.0, &q) + - remainder(100.0, 90.0) + copysign(1.0, -0.0)) + + remainder(100.0, 90.0) + copysign(1.0, -0.0) + + log1p(0.1) + asinh(0.1)) + isnan(0.0);])], [AC_MSG_RESULT([yes]);C99_MATH="-DHAVE_C99_MATH=1"], [AC_MSG_RESULT([no]);C99_MATH="-DHAVE_C99_MATH=0"]) diff --git a/src/Makefile.am b/src/Makefile.am index f94e5f26..78ecfdf8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,7 +43,7 @@ lib_LTLIBRARIES = libproj.la libproj_la_LDFLAGS = -no-undefined -version-info 13:0:0 libproj_la_SOURCES = \ - pj_list.h proj_internal.h\ + pj_list.h proj_internal.h proj_math.h\ PJ_aeqd.c PJ_gnom.c PJ_laea.c PJ_mod_ster.c \ PJ_nsper.c PJ_nzmg.c PJ_ortho.c PJ_stere.c PJ_sterea.c \ PJ_aea.c PJ_bipc.c PJ_bonne.c PJ_eqdc.c PJ_isea.c PJ_ccon.c\ @@ -83,7 +83,7 @@ libproj_la_SOURCES = \ pj_apply_gridshift.c pj_datums.c pj_datum_set.c pj_transform.c \ geocent.c geocent.h pj_utils.c pj_gridinfo.c pj_gridlist.c \ jniproj.c pj_mutex.c pj_initcache.c pj_apply_vgridshift.c geodesic.c \ - pj_strtod.c \ + pj_strtod.c pj_math.c\ \ proj_4D_api.c PJ_cart.c PJ_pipeline.c PJ_horner.c PJ_helmert.c \ PJ_vgridshift.c PJ_hgridshift.c PJ_unitconvert.c PJ_molodensky.c \ diff --git a/src/PJ_aea.c b/src/PJ_aea.c index 3fe90524..640f1013 100644 --- a/src/PJ_aea.c +++ b/src/PJ_aea.c @@ -31,6 +31,8 @@ #include "proj.h" #include #include "projects.h" +#include "proj_math.h" + # define EPS10 1.e-10 # define TOL7 1.e-7 diff --git a/src/PJ_aeqd.c b/src/PJ_aeqd.c index 84554b91..5d8c3d38 100644 --- a/src/PJ_aeqd.c +++ b/src/PJ_aeqd.c @@ -30,6 +30,7 @@ #include "proj.h" #include #include "projects.h" +#include "proj_math.h" enum Mode { N_POLE = 0, diff --git a/src/PJ_bipc.c b/src/PJ_bipc.c index 48fc93d0..2f60808d 100644 --- a/src/PJ_bipc.c +++ b/src/PJ_bipc.c @@ -2,6 +2,7 @@ #include "proj.h" #include #include "projects.h" +#include "proj_math.h" PROJ_HEAD(bipc, "Bipolar conic of western hemisphere") "\n\tConic Sph."; diff --git a/src/PJ_bonne.c b/src/PJ_bonne.c index 40bb28ee..d3d5b757 100644 --- a/src/PJ_bonne.c +++ b/src/PJ_bonne.c @@ -2,6 +2,8 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" + PROJ_HEAD(bonne, "Bonne (Werner lat_1=90)") "\n\tConic Sph&Ell\n\tlat_1="; diff --git a/src/PJ_cart.c b/src/PJ_cart.c index ec273f1b..a4fd3254 100644 --- a/src/PJ_cart.c +++ b/src/PJ_cart.c @@ -43,8 +43,8 @@ #define PJ_LIB__ #include "proj_internal.h" #include "projects.h" +#include "proj_math.h" #include -#include #include PROJ_HEAD(cart, "Geodetic/cartesian conversions"); diff --git a/src/PJ_ccon.c b/src/PJ_ccon.c index 02b14388..aed59fb6 100644 --- a/src/PJ_ccon.c +++ b/src/PJ_ccon.c @@ -24,6 +24,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" #define EPS10 1e-10 diff --git a/src/PJ_deformation.c b/src/PJ_deformation.c index 58c0e4df..5511eed4 100644 --- a/src/PJ_deformation.c +++ b/src/PJ_deformation.c @@ -55,6 +55,7 @@ grid-values in units of mm/year in ENU-space. #include #include "proj.h" #include "proj_internal.h" +#include "proj_math.h" #include "projects.h" PROJ_HEAD(deformation, "Kinematic grid shift"); diff --git a/src/PJ_eqdc.c b/src/PJ_eqdc.c index f36e0518..5f65e7d0 100644 --- a/src/PJ_eqdc.c +++ b/src/PJ_eqdc.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" struct pj_opaque { double phi1; diff --git a/src/PJ_geos.c b/src/PJ_geos.c index f0a9bc24..2988e62e 100644 --- a/src/PJ_geos.c +++ b/src/PJ_geos.c @@ -31,6 +31,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" struct pj_opaque { double h; diff --git a/src/PJ_gnom.c b/src/PJ_gnom.c index 8bb24b6a..b4bab0e2 100644 --- a/src/PJ_gnom.c +++ b/src/PJ_gnom.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" PROJ_HEAD(gnom, "Gnomonic") "\n\tAzi, Sph."; diff --git a/src/PJ_laea.c b/src/PJ_laea.c index 0422784b..bcf9c44d 100644 --- a/src/PJ_laea.c +++ b/src/PJ_laea.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" PROJ_HEAD(laea, "Lambert Azimuthal Equal Area") "\n\tAzi, Sph&Ell"; diff --git a/src/PJ_lcc.c b/src/PJ_lcc.c index 863f6be9..34ed99cb 100644 --- a/src/PJ_lcc.c +++ b/src/PJ_lcc.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" PROJ_HEAD(lcc, "Lambert Conformal Conic") "\n\tConic, Sph&Ell\n\tlat_1= and lat_2= or lat_0"; diff --git a/src/PJ_merc.c b/src/PJ_merc.c index 0bf98625..9123eae1 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -1,6 +1,7 @@ #define PJ_LIB__ #include "proj_internal.h" #include "proj.h" +#include "proj_math.h" #include "projects.h" #include @@ -8,30 +9,10 @@ PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts="; PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Sph\n\t"; #define EPS10 1.e-10 - -#if !defined(HAVE_C99_MATH) -#define HAVE_C99_MATH 0 -#endif - -#if HAVE_C99_MATH -#define log1px log1p -#else -static double log1px(double x) { - volatile double - y = 1 + x, - z = y - 1; - /* Here's the explanation for this magic: y = 1 + z, exactly, and z - * approx x, thus log(y)/z (which is nearly constant near z = 0) returns - * a good approximation to the true log(1 + x)/x. The multiplication x * - * (log(y)/z) introduces little additional error. */ - return z == 0 ? x : x * log(y) / z; -} -#endif - static double logtanpfpim1(double x) { /* log(tan(x/2 + M_FORTPI)) */ if (fabs(x) <= DBL_EPSILON) { /* tan(M_FORTPI + .5 * x) can be approximated by 1.0 + x */ - return log1px(x); + return log1p(x); } return log(tan(M_FORTPI + .5 * x)); } diff --git a/src/PJ_mod_ster.c b/src/PJ_mod_ster.c index d807660c..5e6ce136 100644 --- a/src/PJ_mod_ster.c +++ b/src/PJ_mod_ster.c @@ -2,6 +2,7 @@ #define PJ_LIB__ #include #include "projects.h" +#include "proj_math.h" PROJ_HEAD(mil_os, "Miller Oblated Stereographic") "\n\tAzi(mod)"; PROJ_HEAD(lee_os, "Lee Oblated Stereographic") "\n\tAzi(mod)"; diff --git a/src/PJ_nsper.c b/src/PJ_nsper.c index 3c0b01f0..223cd75b 100644 --- a/src/PJ_nsper.c +++ b/src/PJ_nsper.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" enum Mode { N_POLE = 0, diff --git a/src/PJ_oea.c b/src/PJ_oea.c index 5112896f..2bfeffa8 100644 --- a/src/PJ_oea.c +++ b/src/PJ_oea.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" PROJ_HEAD(oea, "Oblated Equal Area") "\n\tMisc Sph\n\tn= m= theta="; diff --git a/src/PJ_ortho.c b/src/PJ_ortho.c index 7c27cd56..2b037819 100644 --- a/src/PJ_ortho.c +++ b/src/PJ_ortho.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "proj_internal.h" +#include "proj_math.h" #include "projects.h" PROJ_HEAD(ortho, "Orthographic") "\n\tAzi, Sph."; diff --git a/src/PJ_sconics.c b/src/PJ_sconics.c index 34a0f1fd..ce044c24 100644 --- a/src/PJ_sconics.c +++ b/src/PJ_sconics.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" enum Type { diff --git a/src/PJ_stere.c b/src/PJ_stere.c index 62e42460..82fd5c07 100644 --- a/src/PJ_stere.c +++ b/src/PJ_stere.c @@ -2,6 +2,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" PROJ_HEAD(stere, "Stereographic") "\n\tAzi, Sph&Ell\n\tlat_ts="; PROJ_HEAD(ups, "Universal Polar Stereographic") "\n\tAzi, Sph&Ell\n\tsouth"; diff --git a/src/PJ_sterea.c b/src/PJ_sterea.c index 96b35609..eb4c9f2c 100644 --- a/src/PJ_sterea.c +++ b/src/PJ_sterea.c @@ -26,6 +26,7 @@ #define PJ_LIB__ #include #include "projects.h" +#include "proj_math.h" struct pj_opaque { diff --git a/src/PJ_tpeqd.c b/src/PJ_tpeqd.c index 21e3c5ed..87877ec1 100644 --- a/src/PJ_tpeqd.c +++ b/src/PJ_tpeqd.c @@ -1,6 +1,7 @@ #define PJ_LIB__ #include #include "proj.h" +#include "proj_math.h" #include "projects.h" diff --git a/src/gie.c b/src/gie.c index 8c735b88..10b5804e 100644 --- a/src/gie.c +++ b/src/gie.c @@ -114,6 +114,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2017-10-01/2017-10-08 #include "proj.h" #include "proj_internal.h" +#include "proj_math.h" #include "projects.h" #include "optargpm.h" diff --git a/src/hypot.c b/src/hypot.c deleted file mode 100644 index 822c4595..00000000 --- a/src/hypot.c +++ /dev/null @@ -1,36 +0,0 @@ -/* hypot - sqrt(x * x + y * y) -** -** Because this was omitted from the ANSI standards, this version -** is included for those systems that do not include hypot as an -** extension to libm.a. Note: GNU version was not used because it -** was not properly coded to minimize potential overflow. -** -** The proper technique for determining hypot is to factor out the -** larger of the two terms, thus leaving a possible case of float -** overflow when max(x,y)*sqrt(2) > max machine value. This allows -** a wider range of numbers than the alternative of the sum of the -** squares < max machine value. For an Intel x87 IEEE double of -** approximately 1.8e308, only argument values > 1.27e308 are at -** risk of causing overflow. Whereas, not using this method limits -** the range to values less that 9.5e153 --- a considerable reduction -** in range! -*/ -extern double sqrt(double); - double -hypot(double x, double y) { - if ( x < 0.) - x = -x; - else if (x == 0.) - return (y < 0. ? -y : y); - if (y < 0.) - y = -y; - else if (y == 0.) - return (x); - if ( x < y ) { - x /= y; - return ( y * sqrt( 1. + x * x ) ); - } else { - y /= x; - return ( x * sqrt( 1. + y * y ) ); - } -} diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake index c9e4d9e6..c0d0a6a9 100644 --- a/src/lib_proj.cmake +++ b/src/lib_proj.cmake @@ -199,6 +199,7 @@ SET(SRC_LIBPROJ_CORE pj_list.h pj_log.c pj_malloc.c + pj_math.c pj_mlfn.c pj_msfn.c pj_mutex.c @@ -218,6 +219,7 @@ SET(SRC_LIBPROJ_CORE pj_utils.c pj_zpoly1.c proj_mdist.c + proj_math.h proj_rouss.c rtodms.c vector1.c diff --git a/src/makefile.vc b/src/makefile.vc index ee89beb3..ef39b084 100644 --- a/src/makefile.vc +++ b/src/makefile.vc @@ -55,7 +55,7 @@ support = \ pj_utils.obj pj_gridlist.obj pj_gridinfo.obj \ proj_mdist.obj pj_mutex.obj pj_initcache.obj \ pj_ctx.obj pj_fileapi.obj pj_log.obj pj_apply_vgridshift.obj \ - pj_strtod.obj pj_internal.obj + pj_strtod.obj pj_internal.obj pj_math.obj pipeline = \ proj_4D_api.obj PJ_cart.obj PJ_pipeline.obj PJ_horner.obj PJ_helmert.obj \ diff --git a/src/nad_cvt.c b/src/nad_cvt.c index c913511f..d4330d54 100644 --- a/src/nad_cvt.c +++ b/src/nad_cvt.c @@ -1,5 +1,6 @@ #define PJ_LIB__ #include "projects.h" +#include "proj_math.h" #define MAX_ITERATIONS 10 #define TOL 1e-12 diff --git a/src/pj_factors.c b/src/pj_factors.c index e682a12d..373bd743 100644 --- a/src/pj_factors.c +++ b/src/pj_factors.c @@ -1,6 +1,7 @@ /* projection scale factors */ #define PJ_LIB__ #include "proj.h" +#include "proj_math.h" #include "projects.h" #include diff --git a/src/pj_init.c b/src/pj_init.c index 9b06ff28..bdaf64f7 100644 --- a/src/pj_init.c +++ b/src/pj_init.c @@ -37,6 +37,7 @@ #include #include "proj.h" #include "proj_internal.h" +#include "proj_math.h" #include "projects.h" diff --git a/src/pj_math.c b/src/pj_math.c new file mode 100644 index 00000000..d5242636 --- /dev/null +++ b/src/pj_math.c @@ -0,0 +1,66 @@ +/****************************************************************************** + * Project: PROJ + * Purpose: Make C99 math functions available on C89 systems + * Author: Kristian Evers + * + ****************************************************************************** + * Copyright (c) 2018, Kristian Evers + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#include "proj_math.h" + +#if !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) + +/* Compute hypotenuse */ +double pj_hypot(double x, double y) { + x = fabs(x); + y = fabs(y); + if ( x < y ) { + x /= y; + return ( y * sqrt( 1. + x * x ) ); + } else { + y /= (x != 0.0 ? x : 1.0); + return ( x * sqrt( 1. + y * y ) ); + } +} + +/* Compute log(1+x) accurately */ +double pj_log1p(double x) { + volatile double + y = 1 + x, + z = y - 1; + /* Here's the explanation for this magic: y = 1 + z, exactly, and z + * approx x, thus log(y)/z (which is nearly constant near z = 0) returns + * a good approximation to the true log(1 + x)/x. The multiplication x * + * (log(y)/z) introduces little additional error. */ + return z == 0 ? x : x * log(y) / z; +} + +/* Compute asinh(x) accurately */ +double pj_asinh(double x) { + double y = fabs(x); /* Enforce odd parity */ + y = log1p(y * (1 + y/(hypot(1.0, y) + 1))); + return x > 0 ? y : (x < 0 ? -y : x); +} + +#endif /* !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) */ + + diff --git a/src/proj_4D_api.c b/src/proj_4D_api.c index aed4685b..70110746 100644 --- a/src/proj_4D_api.c +++ b/src/proj_4D_api.c @@ -30,6 +30,7 @@ #include #include "proj.h" #include "proj_internal.h" +#include "proj_math.h" #include "projects.h" #include "geodesic.h" diff --git a/src/proj_etmerc.c b/src/proj_etmerc.c index 99646d14..9a89e2b0 100644 --- a/src/proj_etmerc.c +++ b/src/proj_etmerc.c @@ -44,6 +44,7 @@ #include #include "proj.h" #include "projects.h" +#include "proj_math.h" struct pj_opaque { @@ -62,32 +63,6 @@ PROJ_HEAD(utm, "Universal Transverse Mercator (UTM)") #define PROJ_ETMERC_ORDER 6 - -#ifdef _GNU_SOURCE - inline -#endif -static double log1py(double x) { /* Compute log(1+x) accurately */ - volatile double - y = 1 + x, - z = y - 1; - /* Here's the explanation for this magic: y = 1 + z, exactly, and z - * approx x, thus log(y)/z (which is nearly constant near z = 0) returns - * a good approximation to the true log(1 + x)/x. The multiplication x * - * (log(y)/z) introduces little additional error. */ - return z == 0 ? x : x * log(y) / z; -} - - -#ifdef _GNU_SOURCE - inline -#endif -static double asinhy(double x) { /* Compute asinh(x) accurately */ - double y = fabs(x); /* Enforce odd parity */ - y = log1py(y * (1 + y/(hypot(1.0, y) + 1))); - return x < 0 ? -y : y; -} - - #ifdef _GNU_SOURCE inline #endif @@ -182,7 +157,7 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */ Ce = atan2 (sin_Ce*cos_Cn, hypot (sin_Cn, cos_Cn*cos_Ce)); /* compl. sph. N, E -> ell. norm. N, E */ - Ce = asinhy ( tan (Ce) ); /* Replaces: Ce = log(tan(FORTPI + Ce*0.5)); */ + Ce = asinh ( tan (Ce) ); /* Replaces: Ce = log(tan(FORTPI + Ce*0.5)); */ Cn += clenS (Q->gtu, PROJ_ETMERC_ORDER, 2*Cn, 2*Ce, &dCn, &dCe); Ce += dCe; if (fabs (Ce) <= 2.623395162778) { diff --git a/src/proj_math.h b/src/proj_math.h new file mode 100644 index 00000000..0d28cb30 --- /dev/null +++ b/src/proj_math.h @@ -0,0 +1,53 @@ +/****************************************************************************** + * Project: PROJ + * Purpose: Make C99 math functions available on C89 systems + * Author: Kristian Evers + * + ****************************************************************************** + * Copyright (c) 2018, Kristian Evers + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#include + +#ifndef PROJ_MATH_H +#define PROJ_MATH_H +#ifdef __cplusplus +extern "C" { +#endif + +#if !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) + + +double pj_hypot(double x, double y); +double pj_log1p(double x); +double pj_asinh(double x); + +#define hypot pj_hypot +#define log1p pj_log1p +#define asinh pj_asinh + + +#endif /* !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) */ + +#ifdef __cplusplus +} +#endif +#endif /*PROJ_MATH_H */ diff --git a/src/projects.h b/src/projects.h index 5c8d1301..d6d6e23e 100644 --- a/src/projects.h +++ b/src/projects.h @@ -92,11 +92,6 @@ typedef long pj_int32; #define MAX_PATH_FILENAME 1024 #endif -/* prototype hypot for systems where absent */ -#if !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) -extern double hypot(double, double); -#endif - /* If we still haven't got M_PI*, we rely on our own defines. * For example, this is necessary when compiling with gcc and * the -ansi flag. -- cgit v1.2.3 From e197e40e9b9ae99b8dac569428af35036822dca2 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 16 Apr 2018 23:19:42 +0200 Subject: Prefer proj_math.h over math.h when geodesic.c is compiled as part of PROJ --- src/geodesic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/geodesic.c b/src/geodesic.c index eb956c65..5cb273ac 100644 --- a/src/geodesic.c +++ b/src/geodesic.c @@ -24,7 +24,11 @@ */ #include "geodesic.h" +#ifdef PJ_LIB__ +#include "proj_math.h" +#else #include +#endif #if !defined(HAVE_C99_MATH) #define HAVE_C99_MATH 0 -- cgit v1.2.3 From 65d335589b381f9e7b79a1869f74389c3ff59ae5 Mon Sep 17 00:00:00 2001 From: Kurt Schwehr Date: Thu, 19 Apr 2018 09:53:35 -0700 Subject: Rename level -> log_level for proj_log_level to match function definition Found on https://github.com/OSGeo/proj.4/commit/2f082b70cbdafdea49bb123e027406089e7ad65b http://clang.llvm.org/extra/clang-tidy/checks/readability-inconsistent-declaration-parameter-name.html function 'proj_log_level' has a definition with different parameter names src/pj_internal.c:374:14: the definition seen here src/proj.h:364:14: differing parameters are named here: ('level'), in definition: ('log_level') --- src/proj.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proj.h b/src/proj.h index 3d64ed1a..d254eade 100644 --- a/src/proj.h +++ b/src/proj.h @@ -361,7 +361,7 @@ int proj_errno_reset (const PJ *P); int proj_errno_restore (const PJ *P, int err); const char* proj_errno_string (int err); -PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL level); +PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL log_level); void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf); /* Scaling and angular distortion factors */ -- cgit v1.2.3 From 24af7a3f5d459bb6495ee61db88ce54b6eceacb3 Mon Sep 17 00:00:00 2001 From: mwtoews Date: Sun, 22 Apr 2018 20:56:06 +1200 Subject: Rename various Sphinx docs from PROJ.4 to PROJ This also includes the PDF manual, Qt help file, man pages, etc. --- docs/Makefile | 8 ++++---- docs/source/conf.py | 12 ++++++------ docs/source/index.rst | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 4bd082c8..ec0a2e6e 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -94,9 +94,9 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/proj4.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/proj.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/proj4.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/proj.qhc" .PHONY: applehelp applehelp: @@ -113,8 +113,8 @@ devhelp: @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/proj4" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/proj4" + @echo "# mkdir -p $$HOME/.local/share/devhelp/proj" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/proj" @echo "# devhelp" .PHONY: epub diff --git a/docs/source/conf.py b/docs/source/conf.py index fa1de3ed..ae65995c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# PROJ.4 documentation build configuration file, created by +# PROJ documentation build configuration file, created by # sphinx-quickstart on Wed Feb 24 10:47:15 2016. # # This file is execfile()d with the current directory set to its @@ -48,7 +48,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'PROJ.4' +project = u'PROJ' now = datetime.datetime.now() copyright = u'1983-{0}'.format(now.year) author = u'Gerald Evenden, Frank Warmerdam, and others' @@ -211,7 +211,7 @@ html_show_sourcelink = False #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. -htmlhelp_basename = 'proj4doc' +htmlhelp_basename = 'projdoc' # -- Options for LaTeX output --------------------------------------------- @@ -238,7 +238,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'proj4.tex', u'PROJ.4 Documentation', + (master_doc, 'proj.tex', u'PROJ Documentation', u'Gerald Evenden', 'manual'), ] @@ -315,8 +315,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'proj4', u'PROJ.4 Documentation', - author, 'proj4', 'One line description of project.', + (master_doc, 'proj', u'PROJ Documentation', + author, 'proj', 'One line description of project.', 'Miscellaneous'), ] diff --git a/docs/source/index.rst b/docs/source/index.rst index 3f02de3b..9ed64c02 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -26,7 +26,7 @@ Coverage |coverals| :target: https://coveralls.io/r/OSGeo/proj.4?branch=master Full documentation is available as a single PDF at -https://raw.githubusercontent.com/OSGeo/proj.4/gh-pages/proj4.pdf +https://raw.githubusercontent.com/OSGeo/proj.4/gh-pages/proj.pdf Documentation ================= -- cgit v1.2.3 From 656703a278a30a8745a7df08f7d7dffbc057d4b3 Mon Sep 17 00:00:00 2001 From: mwtoews Date: Sun, 22 Apr 2018 21:42:41 +1200 Subject: Improve grammar and use hyphen-minus for latex --- docs/source/geodesic.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/geodesic.rst b/docs/source/geodesic.rst index d54212ca..8f6f5bbe 100644 --- a/docs/source/geodesic.rst +++ b/docs/source/geodesic.rst @@ -10,8 +10,8 @@ Geodesic calculations Introduction ------------ -Consider a ellipsoid of revolution with equatorial radius :math:`a`, polar -semi-axis :math:`b`, and flattening :math:`f=(a−b)/a`. Points on +Consider an ellipsoid of revolution with equatorial radius :math:`a`, polar +semi-axis :math:`b`, and flattening :math:`f=(a-b)/a`. Points on the surface of the ellipsoid are characterized by their latitude :math:`\phi` and longitude :math:`\lambda`. (Note that latitude here means the *geographical latitude*, the angle between the normal to the ellipsoid -- cgit v1.2.3 From 410a515228166399f8c145568f20a7799a450757 Mon Sep 17 00:00:00 2001 From: mwtoews Date: Sun, 22 Apr 2018 21:55:44 +1200 Subject: Fix subtle typo in table syntax --- docs/source/operations/projections/nsper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/operations/projections/nsper.rst b/docs/source/operations/projections/nsper.rst index 3f46f2b4..d204305b 100644 --- a/docs/source/operations/projections/nsper.rst +++ b/docs/source/operations/projections/nsper.rst @@ -18,7 +18,7 @@ The near-sided perspective projection simulates a view from a height +---------------------+-------------------------------------------------------------+ | `+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. | -- cgit v1.2.3 From 027c865d05ff272efc8e2dd2b5148e03e41275a1 Mon Sep 17 00:00:00 2001 From: mwtoews Date: Sun, 22 Apr 2018 22:01:46 +1200 Subject: Use utf8 option for inputenc instead of utf8x According to https://tex.stackexchange.com/q/13067/2951 utf8x should be avoided if possible. Also, define LaTeX for Unicode PRIME character, used in eqc doc pages. --- docs/source/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index ae65995c..5af7a129 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -217,6 +217,9 @@ htmlhelp_basename = 'projdoc' preamble = r""" +\ifdefined\DeclareUnicodeCharacter + \DeclareUnicodeCharacter{2032}{$'$}% prime +\fi """ latex_elements = { @@ -228,7 +231,7 @@ latex_elements = { # Additional stuff for the LaTeX preamble. 'preamble': preamble, -'inputenc':'\usepackage[utf8x]{inputenc}' +'inputenc':'\usepackage[utf8]{inputenc}' # Latex figure (float) alignment #'figure_align': 'htbp', -- cgit v1.2.3 From 3f5657583a3415ea87907a511f97fbb6d64bad93 Mon Sep 17 00:00:00 2001 From: mwtoews Date: Sun, 22 Apr 2018 22:08:30 +1200 Subject: Conditional content for index section, using only directive Test status and coverage content should be shown for HTML. PDF documentation does not to self-reference itself. --- docs/source/index.rst | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 9ed64c02..a0125166 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -9,24 +9,27 @@ and latitude coordinates into cartesian coordinates (and vice versa), and it is a C API for software developers to include coordinate transformation in their own software. PROJ is maintained on `GitHub `_. +.. only:: html -============= ================================================================ - Platform Test Status and Coverage -============= ================================================================ -Travis |travis| -AppVeyor |appveyor| -Coverage |coverals| -============= ================================================================ - -.. |travis| image:: https://travis-ci.org/OSGeo/proj.4.svg?branch=master - :target: https://travis-ci.org/OSGeo/proj.4 -.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/584j49uguwoo5evi?svg=true - :target: https://ci.appveyor.com/project/OSGeo/proj-4 -.. |coverals| image:: https://coveralls.io/repos/OSGeo/proj.4/badge.svg?branch=master - :target: https://coveralls.io/r/OSGeo/proj.4?branch=master - -Full documentation is available as a single PDF at -https://raw.githubusercontent.com/OSGeo/proj.4/gh-pages/proj.pdf + ============= ================================================================ + Platform Test Status and Coverage + ============= ================================================================ + Travis |travis| + AppVeyor |appveyor| + Coverage |coverals| + ============= ================================================================ + + .. |travis| image:: https://travis-ci.org/OSGeo/proj.4.svg?branch=master + :target: https://travis-ci.org/OSGeo/proj.4 + .. |appveyor| image:: https://ci.appveyor.com/api/projects/status/584j49uguwoo5evi?svg=true + :target: https://ci.appveyor.com/project/OSGeo/proj-4 + .. |coverals| image:: https://coveralls.io/repos/OSGeo/proj.4/badge.svg?branch=master + :target: https://coveralls.io/r/OSGeo/proj.4?branch=master + +.. only:: not latex + + Full documentation is available as a single PDF at + https://raw.githubusercontent.com/OSGeo/proj.4/gh-pages/proj.pdf Documentation ================= -- cgit v1.2.3 From 8bcf78e471d0a7dbc5ea7387d33301188ae17de8 Mon Sep 17 00:00:00 2001 From: mwtoews Date: Sun, 22 Apr 2018 22:24:20 +1200 Subject: Change title and author to reflect CITATION --- docs/source/conf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 5af7a129..2c0f480b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -49,9 +49,10 @@ master_doc = 'index' # General information about the project. project = u'PROJ' +title = 'PROJ coordinate transformation software library' +author = 'PROJ contributors' now = datetime.datetime.now() copyright = u'1983-{0}'.format(now.year) -author = u'Gerald Evenden, Frank Warmerdam, and others' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -241,8 +242,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'proj.tex', u'PROJ Documentation', - u'Gerald Evenden', 'manual'), + (master_doc, 'proj.tex', title, author, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -318,8 +318,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'proj', u'PROJ Documentation', - author, 'proj', 'One line description of project.', + (master_doc, 'proj', title, author, 'proj', + 'Cartographic projections software library.', 'Miscellaneous'), ] -- cgit v1.2.3 From 613d95ef99f29fcf42fab27d1ef26adb87745e35 Mon Sep 17 00:00:00 2001 From: Kurt Schwehr Date: Sun, 22 Apr 2018 07:52:59 -0700 Subject: PJ_isea.c: change local helper functions to void returns The return values are not used and do not mean anything. Similar to #423 --- src/PJ_isea.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/PJ_isea.c b/src/PJ_isea.c index 57412a38..6c870a2b 100644 --- a/src/PJ_isea.c +++ b/src/PJ_isea.c @@ -29,7 +29,7 @@ struct hex { /* y *must* be positive down as the xy /iso conversion assumes this */ ISEA_STATIC -int hex_xy(struct hex *h) { +void hex_xy(struct hex *h) { if (!h->iso) return 1; if (h->x >= 0) { h->y = -h->y - (h->x+1)/2; @@ -38,12 +38,10 @@ int hex_xy(struct hex *h) { h->y = -h->y - h->x/2; } h->iso = 0; - - return 1; } ISEA_STATIC -int hex_iso(struct hex *h) { +void hex_iso(struct hex *h) { if (h->iso) return 1; if (h->x >= 0) { @@ -55,12 +53,10 @@ int hex_iso(struct hex *h) { h->z = -h->x - h->y; h->iso = 1; - return 1; } ISEA_STATIC -int hexbin2(double width, double x, double y, - int *i, int *j) { +void hexbin2(double width, double x, double y, int *i, int *j) { double z, rx, ry, rz; double abs_dx, abs_dy, abs_dz; int ix, iy, iz, s; @@ -105,7 +101,6 @@ int hexbin2(double width, double x, double y, hex_xy(&h); *i = h.x; *j = h.y; - return ix * 100 + iy; } #ifndef ISEA_STATIC #define ISEA_STATIC @@ -1134,4 +1129,3 @@ PJ *PROJECTION(isea) { return P; } - -- cgit v1.2.3 From 454c1326e5f1cae87712b011434776375ac84fbb Mon Sep 17 00:00:00 2001 From: Kurt Schwehr Date: Sun, 22 Apr 2018 08:17:56 -0700 Subject: More cleanup and fix last commit Tried building before committing time --- src/PJ_isea.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/PJ_isea.c b/src/PJ_isea.c index 6c870a2b..3e941c77 100644 --- a/src/PJ_isea.c +++ b/src/PJ_isea.c @@ -30,7 +30,7 @@ struct hex { /* y *must* be positive down as the xy /iso conversion assumes this */ ISEA_STATIC void hex_xy(struct hex *h) { - if (!h->iso) return 1; + if (!h->iso) return; if (h->x >= 0) { h->y = -h->y - (h->x+1)/2; } else { @@ -42,7 +42,7 @@ void hex_xy(struct hex *h) { ISEA_STATIC void hex_iso(struct hex *h) { - if (h->iso) return 1; + if (h->iso) return; if (h->x >= 0) { h->y = (-h->y - (h->x+1)/2); @@ -600,27 +600,27 @@ isea_grid_init(struct isea_dgg * g) } ISEA_STATIC -int +void isea_orient_isea(struct isea_dgg * g) { if (!g) - return 0; + return; g->o_lat = ISEA_STD_LAT; g->o_lon = ISEA_STD_LON; g->o_az = 0.0; - return 1; + return; } ISEA_STATIC -int +void isea_orient_pole(struct isea_dgg * g) { if (!g) - return 0; + return; g->o_lat = M_PI / 2.0; g->o_lon = 0.0; g->o_az = 0; - return 1; + return; } ISEA_STATIC -- cgit v1.2.3 From d89dc16aef1ac01a5b8a1987880f4e513bac5d77 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 22 Apr 2018 22:55:35 +0200 Subject: Collaps multiline strings to not trip up CMake2 --- CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a02d247..6d7c4f77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,16 +23,11 @@ endif () if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") # Suppress warning 4706 about assignment within conditional expression # Suppress warning 4996 about sprintf, etc., being unsafe - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4706 /wd4996 \ - /D_CRT_SECURE_NO_WARNINGS") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4706 /wd4996 /D_CRT_SECURE_NO_WARNINGS") elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wswitch -Wshadow \ - -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat \ - -Wformat-security") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Wformat-security") elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wswitch -Wshadow \ - -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat \ - -Wformat-security -Wfloat-conversion -Wc99-extensions -Wc11-extensions") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Wformat-security -Wfloat-conversion -Wc99-extensions -Wc11-extensions") endif() # Tell Intel compiler to do arithmetic accurately. This is needed to -- cgit v1.2.3 From 6f640d76e13cb643574b44b7498d51ecff6fb83e Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 22 Apr 2018 22:39:57 +0200 Subject: Add isnan() to proj_math.h Code updated to use isnan() instead of pj_is_nan(). --- src/PJ_robin.c | 5 +++-- src/geodesic.c | 3 +-- src/nad_intr.c | 5 +++-- src/pj_apply_vgridshift.c | 4 ++-- src/pj_internal.c | 16 ---------------- src/pj_math.c | 7 ++++++- src/proj_math.h | 2 ++ 7 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/PJ_robin.c b/src/PJ_robin.c index 92aebfd3..a1d5ad4d 100644 --- a/src/PJ_robin.c +++ b/src/PJ_robin.c @@ -1,4 +1,5 @@ #define PJ_LIB__ +#include "proj_math.h" #include "proj_internal.h" #include "proj.h" #include "projects.h" @@ -82,7 +83,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ (void) P; dphi = fabs(lp.phi); - i = pj_is_nan(lp.phi) ? -1 : (int)floor(dphi * C1); + i = isnan(lp.phi) ? -1 : (int)floor(dphi * C1); if( i < 0 ){ proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION); return xy; @@ -117,7 +118,7 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */ } } else { /* general problem */ /* in Y space, reduce to table interval */ - i = pj_is_nan(lp.phi) ? -1 : (int)floor(lp.phi * NODES); + i = isnan(lp.phi) ? -1 : (int)floor(lp.phi * NODES); if( i < 0 || i >= NODES ) { proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION); return lp; diff --git a/src/geodesic.c b/src/geodesic.c index 5cb273ac..9904c7fa 100644 --- a/src/geodesic.c +++ b/src/geodesic.c @@ -243,8 +243,7 @@ static void sincosdx(real x, real* sinx, real* cosx) { r = remquo(x, (real)(90), &q); #else r = fmod(x, (real)(360)); - /* check for NaN -- do not use pj_is_nan, since we want geodesic.c not to - * depend on the rest of proj.4 */ + /* check for NaN */ q = r == r ? (int)(floor(r / 90 + (real)(0.5))) : 0; r -= 90 * q; #endif diff --git a/src/nad_intr.c b/src/nad_intr.c index dc245831..80e428ed 100644 --- a/src/nad_intr.c +++ b/src/nad_intr.c @@ -1,6 +1,7 @@ /* Determine nad table correction value */ #define PJ_LIB__ #include "proj_internal.h" +#include "proj_math.h" #include "projects.h" LP @@ -13,9 +14,9 @@ nad_intr(LP t, struct CTABLE *ct) { int in; t.lam /= ct->del.lam; - indx.lam = pj_is_nan(t.lam) ? 0 : (int)floor(t.lam); + indx.lam = isnan(t.lam) ? 0 : (int)floor(t.lam); t.phi /= ct->del.phi; - indx.phi = pj_is_nan(t.phi) ? 0 : (int)floor(t.phi); + indx.phi = isnan(t.phi) ? 0 : (int)floor(t.phi); frct.lam = t.lam - indx.lam; frct.phi = t.phi - indx.phi; diff --git a/src/pj_apply_vgridshift.c b/src/pj_apply_vgridshift.c index 05803bc8..e7106b25 100644 --- a/src/pj_apply_vgridshift.c +++ b/src/pj_apply_vgridshift.c @@ -29,7 +29,7 @@ #define PJ_LIB__ #include -#include +#include "proj_math.h" #include "proj_internal.h" #include "projects.h" @@ -42,7 +42,7 @@ static double read_vgrid_value( PJ *defn, LP input, int *gridlist_count_p, PJ_GR float *cvs; /* do not deal with NaN coordinates */ /* cppcheck-suppress duplicateExpression */ - if( pj_is_nan(input.phi) || pj_is_nan(input.lam) ) + if( isnan(input.phi) || isnan(input.lam) ) itable = *gridlist_count_p; /* keep trying till we find a table that works */ diff --git a/src/pj_internal.c b/src/pj_internal.c index 891e0b9f..dc528649 100644 --- a/src/pj_internal.c +++ b/src/pj_internal.c @@ -438,19 +438,3 @@ void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf) { if (0!=logf) ctx->logger = logf; } - - -#if HAVE_C99_MATH -/* proj_internal.h defines pj_is_nan as isnan */ -#else -/*****************************************************************************/ -int pj_is_nan (double val) { -/****************************************************************************** - Returns 0 if not a NaN and non-zero if val is a NaN. - - Provides an equivalent to isnan(). -******************************************************************************/ - /* cppcheck-suppress duplicateExpression */ - return val != val; -} -#endif diff --git a/src/pj_math.c b/src/pj_math.c index d5242636..751c2750 100644 --- a/src/pj_math.c +++ b/src/pj_math.c @@ -61,6 +61,11 @@ double pj_asinh(double x) { return x > 0 ? y : (x < 0 ? -y : x); } -#endif /* !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) */ +/* Returns 0 if not a NaN and non-zero if val is a NaN */ +int pj_isnan (double x) { + /* cppcheck-suppress duplicateExpression */ + return x != x; +} +#endif /* !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) */ diff --git a/src/proj_math.h b/src/proj_math.h index 0d28cb30..0108a439 100644 --- a/src/proj_math.h +++ b/src/proj_math.h @@ -39,10 +39,12 @@ extern "C" { double pj_hypot(double x, double y); double pj_log1p(double x); double pj_asinh(double x); +int pj_isnan(double x); #define hypot pj_hypot #define log1p pj_log1p #define asinh pj_asinh +#define isnan pj_isnan #endif /* !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) */ -- cgit v1.2.3 From 80c5e198ed05ec26332501c36ee5150655545cdd Mon Sep 17 00:00:00 2001 From: mwtoews Date: Mon, 23 Apr 2018 20:29:04 +1200 Subject: Restore project as PROJ.4 No distinction is required between version and release. Disable default highlight_language (was effectively Python) --- docs/source/conf.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 2c0f480b..375b6b5a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -48,20 +48,24 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'PROJ' + +# Keep legacy project name +project = 'PROJ.4' + +# See CITATION file title = 'PROJ coordinate transformation software library' author = 'PROJ contributors' + now = datetime.datetime.now() copyright = u'1983-{0}'.format(now.year) # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. -# -# The short X.Y version. -version = u'5.0.1' -# The full version, including alpha/beta/rc tags. -release = u'5.0.0' +version = '5.0.1' + +# use same |release| as |version| +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -98,6 +102,9 @@ exclude_patterns = [] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' +# Specify default language for syntax highlighting. +highlight_language = 'none' + # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] -- cgit v1.2.3 From c5b1d6b92755bb3a25d38c60be574e015e1e03d7 Mon Sep 17 00:00:00 2001 From: mwtoews Date: Wed, 25 Apr 2018 22:07:14 +1200 Subject: updated PDF file name to copy to gh-pages also modify proj4docs -> projdocs (should be harmless, as this is a working directory within /tmp) --- travis/deploy_website.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/travis/deploy_website.sh b/travis/deploy_website.sh index 80cd03c6..07e2c556 100755 --- a/travis/deploy_website.sh +++ b/travis/deploy_website.sh @@ -4,16 +4,16 @@ builddir=$1 destdir=$2 -git clone git@github.com:OSGeo/proj.4.git $destdir/proj4docs -cd $destdir/proj4docs +git clone git@github.com:OSGeo/proj.4.git $destdir/projdocs +cd $destdir/projdocs git checkout gh-pages cd $builddir/html -cp -rf * $destdir/proj4docs -cp $builddir/latex/proj4.pdf $destdir/proj4docs +cp -rf * $destdir/projdocs +cp $builddir/latex/proj.pdf $destdir/projdocs -cd $destdir/proj4docs +cd $destdir/projdocs git config user.email "proj4bot@proj4.bot" git config user.name "proj.4 deploybot" -- cgit v1.2.3 From 0dc275a312c1b2ddefc066c66787eb8274d60f08 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Apr 2018 22:03:41 +0200 Subject: pj_transform: reset error state before each call to pj_inv/pj_fwd Fixes issues raised in https://lists.osgeo.org/pipermail/gdal-dev/2018-April/048446.html The use case is that pj_transform() is called from geos projection to something else, with multiple coordinates. If one of the coordinate tuple fails the inverse transform of geos, it fails with PJD_ERR_TOLERANCE_CONDITION. Causing all following coordinates to fail since the error state is not reset. --- src/pj_transform.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pj_transform.c b/src/pj_transform.c index 22b685b2..aaa8c1e4 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -42,6 +42,8 @@ enum PJ_DIRECTION { }; typedef enum PJ_DIRECTION PJ_DIRECTION; +/* Copied from proj.h FIXME */ +int proj_errno_reset (const PJ *P); static int adjust_axis( projCtx ctx, const char *axis, int denormalize_flag, @@ -199,6 +201,7 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double * if (geodetic_loc.u == HUGE_VAL) continue; + proj_errno_reset( P ); projected_loc = pj_fwd3d( geodetic_loc, P); if( P->ctx->last_errno != 0 ) { @@ -234,6 +237,7 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double * if( geodetic_loc.u == HUGE_VAL ) continue; + proj_errno_reset( P ); projected_loc = pj_fwd( geodetic_loc, P ); if( P->ctx->last_errno != 0 ) { @@ -301,6 +305,7 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double * if (projected_loc.u == HUGE_VAL) continue; + proj_errno_reset( P ); geodetic_loc = pj_inv3d(projected_loc, P); if( P->ctx->last_errno != 0 ) { @@ -337,6 +342,7 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double * if( projected_loc.u == HUGE_VAL ) continue; + proj_errno_reset( P ); geodetic_loc = pj_inv( projected_loc, P ); if( P->ctx->last_errno != 0 ) { -- cgit v1.2.3 From 56f089510a170164ffc4792a7f7c57ba8f64f1c9 Mon Sep 17 00:00:00 2001 From: Martin Desruisseaux Date: Fri, 27 Apr 2018 10:47:44 +0200 Subject: Remove src/org_proj4_Projections.h file. This file was not used anywhere, since it was replaced by org_proj4_PJ file since 2012. --- src/Makefile.am | 2 +- src/lib_proj.cmake | 3 +-- src/org_proj4_Projections.h | 37 ------------------------------------- 3 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 src/org_proj4_Projections.h diff --git a/src/Makefile.am b/src/Makefile.am index 78ecfdf8..971ac78c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,7 +10,7 @@ AM_CPPFLAGS = -DPROJ_LIB=\"$(pkgdatadir)\" \ -DMUTEX_@MUTEX_SETTING@ @JNI_INCLUDE@ include_HEADERS = proj.h proj_api.h projects.h geodesic.h \ - org_proj4_Projections.h org_proj4_PJ.h + org_proj4_PJ.h EXTRA_DIST = makefile.vc proj.def bin_cct.cmake bin_gie.cmake bin_cs2cs.cmake \ bin_geod.cmake bin_nad2bin.cmake bin_proj.cmake \ diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake index c0d0a6a9..82a8fc81 100644 --- a/src/lib_proj.cmake +++ b/src/lib_proj.cmake @@ -258,8 +258,7 @@ if(JNI_SUPPORT) set(SRC_LIBPROJ_CORE ${SRC_LIBPROJ_CORE} jniproj.c ) set(HEADERS_LIBPROJ ${HEADERS_LIBPROJ} - org_proj4_PJ.h - org_proj4_Projections.h) + org_proj4_PJ.h) source_group("Source Files\\JNI" FILES ${SRC_LIBPROJ_JNI}) add_definitions(-DJNI_ENABLED) include_directories( ${JNI_INCLUDE_DIRS}) diff --git a/src/org_proj4_Projections.h b/src/org_proj4_Projections.h deleted file mode 100644 index 3841e057..00000000 --- a/src/org_proj4_Projections.h +++ /dev/null @@ -1,37 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_proj4_Projections */ - -#ifndef _Included_org_proj4_Projections -#define _Included_org_proj4_Projections -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_proj4_Projections - * Method: getProjInfo - * Signature: (Ljava/lang/String;)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_proj4_Projections_getProjInfo - (JNIEnv *, jobject, jstring); - -/* - * Class: org_proj4_Projections - * Method: getEllipsInfo - * Signature: (Ljava/lang/String;)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_proj4_Projections_getEllipsInfo - (JNIEnv *, jobject, jstring); - -/* - * Class: org_proj4_Projections - * Method: transform - * Signature: ([D[D[DLjava/lang/String;Ljava/lang/String;JI)V - */ -JNIEXPORT void JNICALL Java_org_proj4_Projections_transform - (JNIEnv *, jobject, jdoubleArray, jdoubleArray, jdoubleArray, jstring, jstring, jlong, jint); - -#ifdef __cplusplus -} -#endif -#endif -- cgit v1.2.3 From 44b83cbb394639f6c393c349b56360af27bc3020 Mon Sep 17 00:00:00 2001 From: Martin Desruisseaux Date: Fri, 27 Apr 2018 15:42:36 +0200 Subject: Apply the https://github.com/opengeospatial/geoapi/issues/26 patch. Update contributor names in copyright header. --- src/jniproj.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/jniproj.c b/src/jniproj.c index 85d984da..072fa04c 100644 --- a/src/jniproj.c +++ b/src/jniproj.c @@ -5,7 +5,9 @@ * Martin Desruisseaux * ****************************************************************************** - * Copyright (c) 2005, Antonello Andrea + * Copyright (c) 2005, Andrea Antonello + * Copyright (c) 2011, Martin Desruisseaux + * Copyright (c) 2018, Even Rouault * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -351,11 +353,8 @@ void convertAngularOrdinates(PJ *pj, double* data, jint numPts, int dimension, d if (pj_is_latlong(pj)) { /* Convert only the 2 first ordinates and skip all the other dimensions. */ dimToSkip = dimension - 2; - } else if (pj_is_geocent(pj)) { - /* Convert only the 3 first ordinates and skip all the other dimensions. */ - dimToSkip = dimension - 3; } else { - /* Not a geographic or geocentric CRS: nothing to convert. */ + /* Not a geographic CRS: nothing to convert. */ return; } double *stop = data + dimension*numPts; -- cgit v1.2.3 From aef6d05bfe86b810dbd38dbdb9c757dae7b8368e Mon Sep 17 00:00:00 2001 From: Martin Desruisseaux Date: Fri, 27 Apr 2018 18:15:08 +0200 Subject: Update the Ant build.xml script for: - Generating the C header file during javac task. - Provide more accurate information in META-INF/MANIFEST.MF. - Merge tasks intended to be executed together. The src/org_proj4_PJ.h file has been re-generated with the most recent Java compiler. --- jniwrap/build.xml | 107 ++++++++++++++++++----------------------------------- src/org_proj4_PJ.h | 2 +- 2 files changed, 38 insertions(+), 71 deletions(-) diff --git a/jniwrap/build.xml b/jniwrap/build.xml index 2888a1ec..85bcb2a5 100644 --- a/jniwrap/build.xml +++ b/jniwrap/build.xml @@ -1,87 +1,54 @@ - - - - - - - - - - - - - - - Compilation finished... - - - - - - - Creating folder structure... - - - - - - - - - Compiling the java code... - - - - - - - - - - - - - Creating jni headers... - - - - - - - - Compiling libraries... - - - - - - - - + + + + + + + + + + + + + + + + - + + + + - - - - + + Creating help files... - - - + Cleaning up... - - + + diff --git a/src/org_proj4_PJ.h b/src/org_proj4_PJ.h index 7e690e7a..be5d3f58 100644 --- a/src/org_proj4_PJ.h +++ b/src/org_proj4_PJ.h @@ -44,7 +44,7 @@ JNIEXPORT jstring JNICALL Java_org_proj4_PJ_getDefinition /* * Class: org_proj4_PJ * Method: getType - * Signature: ()Lorg/proj4/PJ$Type; + * Signature: ()Lorg/proj4/PJ/Type; */ JNIEXPORT jobject JNICALL Java_org_proj4_PJ_getType (JNIEnv *, jobject); -- cgit v1.2.3 From 27d881add3d1fcd219c6b6ad455ef1c8b2a5abc3 Mon Sep 17 00:00:00 2001 From: Martin Desruisseaux Date: Fri, 27 Apr 2018 18:17:53 +0200 Subject: Ignore output files and shutdown a warning. --- .gitignore | 3 +++ jniwrap/org/proj4/PJ.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index dcb234ba..a300b132 100644 --- a/.gitignore +++ b/.gitignore @@ -94,4 +94,7 @@ README /src/gie /src/geodtest +# Java bridge +jniwrap/out + /docs/build diff --git a/jniwrap/org/proj4/PJ.java b/jniwrap/org/proj4/PJ.java index 50e7a021..6b387287 100644 --- a/jniwrap/org/proj4/PJ.java +++ b/jniwrap/org/proj4/PJ.java @@ -288,5 +288,6 @@ public class PJ { * NEVER INVOKE THIS METHOD EXPLICITLY, NEVER OVERRIDE. */ @Override + @SuppressWarnings("deprecation") protected final native void finalize(); } -- cgit v1.2.3 From f477d608aa9cfdc3e2265034ca4fbdbe1dfc4c4d Mon Sep 17 00:00:00 2001 From: Martin Desruisseaux Date: Fri, 27 Apr 2018 18:42:10 +0200 Subject: Renamed jniwrap/README as README.md for better integration with GitHub. Reformatted the README.md content for Markdown syntax. Updated some content to reflect the changes applied in build.xml file. --- jniwrap/Makefile.am | 2 +- jniwrap/README | 128 ---------------------------------------------------- jniwrap/README.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 129 deletions(-) delete mode 100644 jniwrap/README create mode 100644 jniwrap/README.md diff --git a/jniwrap/Makefile.am b/jniwrap/Makefile.am index 595093f6..908eee37 100644 --- a/jniwrap/Makefile.am +++ b/jniwrap/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST = build.xml doxygen.cfg README +EXTRA_DIST = build.xml doxygen.cfg README.md SUBDIRS = org diff --git a/jniwrap/README b/jniwrap/README deleted file mode 100644 index 1c047db0..00000000 --- a/jniwrap/README +++ /dev/null @@ -1,128 +0,0 @@ - -------------------- J P R O J . 4 -------------------- - -This is the second release of JNI wrappers for the main proj4 functions. - -PLEASE read the following information. - -The first release of JNI wrappers were created by: - - http://www.hydrologis.com - -For more information regarding the current release please see the web page at: - - http://www.geoapi.org/geoapi-proj4/ - - --------------------------------------------------- - - -What is "Proj.4 wrapper": -------------- - -"Proj.4 wrapper" is a small library of Java classes that wrap a few Proj.4 functions by -using the Java Native Interface (JNI). The main Java class is org.proj4.PJ. - - -Compilation: -------------- - -To compile the native part, configure has to be run in the proj directory like this: - - CFLAGS=-Iinclude2 ./configure --with-jni=include1 - -where - - include1 = folder in which the header file jni.h resides (usually $JAVA_HOME/include) - include2 = folder in which the header file jni_md.h resides (usually $JAVA_HOME/include/linux or whatever) - -On MacOS, those two folders are /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/include/ - - -The java part is compiled by running ant inside the "jniwrap" folder. -This will compile the classes and archive them in a jar library. -It applies to Linux, Macos and Windows (and virtually to every system -supporting java). - - -Requirements: -------------- - -Beyond the ones already put by Proj.4, you need: -- JSE 1.5+, the Java standard development kit version 1.5 or above -- Ant, to run the build -- Doxygen for the documentation generation - - -Documentation: --------------- - -The documentation is held inside the code and can be retrieved by running -doxygen inside the folder jniwrap. This will create the HTML format -documentation inside of jniwrap/docs - -The standard way to achieve this is to use an Ant target: - - ant do_make_help - - -License: --------- - -GPL for the first release -Proj.4 license for the second release. - - -Authors: --------- - -Andrea Antonello (andrea.antonello@hydrologis.com) -Martin Desruisseaux (martin.desruisseaux@geomatys.fr) - - -Usage & a fast example: ------------------------ - -The jproj.jar is all is needed to implement proj support in java applications. -The whole job is done by the proj4, so there are just a couple of functions that -be used. - -The best way is to see everything through an example. -In the following example we create two Coordinate System and transform 3 points. -The Coordinate System and the points are hard-coded for simplicity. Of course, -real applications would read them from a file or other data source. - -________________________________________________________________________________ -import org.proj4.*; -import java.util.Arrays; - - -/** - * Converts coordinates from EPSG:32632 (WGS 84 / UTM zone 32N) to WGS84, - * then prints the result to the standard output stream. - */ -public class Main { - public static void main(String[] args) throws PJException { - PJ sourcePJ = new PJ("+init=epsg:32632"); // (x,y) axis order - PJ targetPJ = new PJ("+proj=latlong +datum=WGS84"); // (λ,φ) axis order - double[] coordinates = { - 500000, 0, // First coordinate - 400000, 100000, // Second coordinate - 600000, -100000 // Third coordinate - }; - sourcePJ.transform(targetPJ, 2, coordinates, 0, 3); - System.out.println(Arrays.toString(coordinates)); - } -} -________________________________________________________________________________ - -compile the Main code: -we assume that proj was compiled with the right flag to support jproj. -Therefore we have a library called jproj.jar. -Thus we compile the Main.java with the command: - -javac -classpath /jproj.jar Main.java - -and execute the created test case with: - -java -cp .:/jproj.jar -Djava.library.path= Main - -That's it, enjoy! diff --git a/jniwrap/README.md b/jniwrap/README.md new file mode 100644 index 00000000..45772d1f --- /dev/null +++ b/jniwrap/README.md @@ -0,0 +1,120 @@ +# Proj bridge to Java + +This is the third release of JNI wrappers for the main Proj functions. +The first release of JNI wrappers were created by http://www.hydrologis.com. +The second release of JNI wrappers were created by http://www.geoapi.org. + + + +## What is "Proj bridge to Java" + +_Proj bridge to Java_ is a small library of Java classes that wrap a few Proj functions +by using the Java Native Interface (JNI). The main Java class is `org.proj4.PJ`. + + + +### Compilation + +To compile the native part, `configure` has to be run in the Proj directory like this: + + CFLAGS=-Iinclude2 ./configure --with-jni=include1 + +where + +* `include1` = folder in which the header file `jni.h` resides (usually `$JAVA_HOME/include`) +* `include2` = folder in which the header file `jni_md.h` resides (usually `$JAVA_HOME/include/linux` or whatever) + +On MacOS, those two folders are `/Library/Java/JavaVirtualMachines/.../Contents/Home/include/`. + + +The java part is compiled by running Ant inside the `jniwrap` folder. +This will compile the classes and archive them in a JAR file. +It applies to Linux, MacOS and Windows (and virtually to every system supporting java). + + + +### Requirements + +Beyond the ones already put by Proj, you need: + +* For compilation: + * Java 9+, the Java standard development kit version 9 or above + * Ant 1.9.8+, to run the build. +* For execution: + * If a Java version less than the current version on the local machine is desired, + add an `release` attribute in the `javac` task of `build.xml`. + + + +### Documentation + +The documentation is held inside the code and can be retrieved by running +doxygen inside the folder jniwrap. This will create the HTML format +documentation inside of jniwrap/docs + +The standard way to achieve this is to use an Ant target: + + ant do_make_help + + + +### License + +GPL for the first release. +Proj.4 license for the second release. + + + +### Authors + +* Andrea Antonello (andrea.antonello@hydrologis.com) +* Martin Desruisseaux (martin.desruisseaux@geomatys.com) + + + +## Usage & a fast example: + +The `proj.jar` is all is needed to implement Proj support in java applications. +The whole job is done by the Proj library, so there are just a couple of functions that be used. + +The best way is to see everything through an example. +In the following example we create two Coordinate Reference System and transform 3 points. +The Coordinate Reference Systems and the points are hard-coded for simplicity. +Of course, real applications would read them from a file or other data source. + + import org.proj4.*; + import java.util.Arrays; + + /** + * Converts coordinates from EPSG:32632 (WGS 84 / UTM zone 32N) to WGS84, + * then prints the result to the standard output stream. + */ + public class Main { + public static void main(String[] args) throws PJException { + PJ sourcePJ = new PJ("+init=epsg:32632"); // (x,y) axis order + PJ targetPJ = new PJ("+proj=latlong +datum=WGS84"); // (λ,φ) axis order + double[] coordinates = { + 500000, 0, // First coordinate + 400000, 100000, // Second coordinate + 600000, -100000 // Third coordinate + }; + sourcePJ.transform(targetPJ, 2, coordinates, 0, 3); + System.out.println(Arrays.toString(coordinates)); + } + } + + + +### compile the Main code + +we assume that Proj was compiled with the right flag to support the bridge to Java +Therefore we have a library called `proj.jar`. +Thus we compile the `Main.java` with the command: + + javac -classpath /proj.jar Main.java + +and execute the created test case with: + + java -cp .:/proj.jar -Djava.library.path= Main + +That's it, enjoy! -- cgit v1.2.3 From 1c1dc406893dca639a93a3c7d2a196582a469c37 Mon Sep 17 00:00:00 2001 From: Martin Desruisseaux Date: Fri, 27 Apr 2018 18:44:58 +0200 Subject: Replace the use of doxygen by standard Javadoc tools for jniwrap. --- jniwrap/Makefile.am | 2 +- jniwrap/README.md | 8 +- jniwrap/build.xml | 16 +- jniwrap/doxygen.cfg | 1719 --------------------------------------------------- 4 files changed, 9 insertions(+), 1736 deletions(-) delete mode 100644 jniwrap/doxygen.cfg diff --git a/jniwrap/Makefile.am b/jniwrap/Makefile.am index 908eee37..4a176362 100644 --- a/jniwrap/Makefile.am +++ b/jniwrap/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST = build.xml doxygen.cfg README.md +EXTRA_DIST = build.xml README.md SUBDIRS = org diff --git a/jniwrap/README.md b/jniwrap/README.md index 45772d1f..20c2c86c 100644 --- a/jniwrap/README.md +++ b/jniwrap/README.md @@ -49,12 +49,8 @@ Beyond the ones already put by Proj, you need: ### Documentation The documentation is held inside the code and can be retrieved by running -doxygen inside the folder jniwrap. This will create the HTML format -documentation inside of jniwrap/docs - -The standard way to achieve this is to use an Ant target: - - ant do_make_help +`ant javadoc` inside the folder `jniwrap`. This will create the HTML format +documentation inside of `jniwrap/out/apidocs` diff --git a/jniwrap/build.xml b/jniwrap/build.xml index 85bcb2a5..7e95e676 100644 --- a/jniwrap/build.xml +++ b/jniwrap/build.xml @@ -1,5 +1,5 @@ - + - - Creating help files... - - - + + - Cleaning up... - - diff --git a/jniwrap/doxygen.cfg b/jniwrap/doxygen.cfg deleted file mode 100644 index e1771b52..00000000 --- a/jniwrap/doxygen.cfg +++ /dev/null @@ -1,1719 +0,0 @@ -# Doxyfile 1.7.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = JPROJ4 - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = ./docs/ - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = NO - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = NO - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = YES - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = YES - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = NO - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = NO - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= NO - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = NO - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../src/jniproj.c \ - org/ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.java \ - *.c \ - *.h - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = NO - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the -# mathjax.org site, so you can quickly see the result without installing -# MathJax, but it is strongly recommended to install a local copy of MathJax -# before deployment. - -MATHJAX_RELPATH = http://www.mathjax.org/mathjax - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = NO - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called Helvetica to the output -# directory and reference it in all dot files that doxygen generates. -# When you want a differently looking font you can specify the font name -# using DOT_FONTNAME. You need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES -- cgit v1.2.3 From 4bb5771fbc813ce3a71413418f4e926978f21be8 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 30 Apr 2018 09:45:32 +0200 Subject: Remove unneeded pj_is_nan definition --- src/proj_internal.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/proj_internal.h b/src/proj_internal.h index 1aca9201..30a4a89e 100644 --- a/src/proj_internal.h +++ b/src/proj_internal.h @@ -118,12 +118,6 @@ void proj_fileapi_set (PJ *P, void *fileapi); const char * const *proj_get_searchpath(void); int proj_get_path_count(void); -#if HAVE_C99_MATH -#define pj_is_nan isnan -#else -int pj_is_nan (double val); -#endif - #ifdef __cplusplus } #endif -- cgit v1.2.3