aboutsummaryrefslogtreecommitdiff
path: root/docs
AgeCommit message (Collapse)Author
2021-02-14CMake: Prefer keyword signature of target_link_libraries commandMateusz Łoskot
Closes #2515
2021-02-10operations_computation.rst: update 'Filtering and sorting of coordinate ↵Even Rouault
operations' section
2021-02-07Merge pull request #2476 from rouault/fix_2399Kristian Evers
Add build time option to make PROJ_LIB env var tested last (fixes #2399)
2021-02-07CI: specify pip < 21.0; avoid using pip3 script (#2516)Mike Taves
2021-01-17update julia binding descriptionMartijn Visser
This matches the go binding description. And fixes the colon.
2021-01-17fix a few typos in the docsMartijn Visser
2021-01-01Update website for 7.2.1Kristian Evers
2020-12-17Merge pull request #2491 from glostis/documentationEven Rouault
Fix typos in resource_files.rst
2020-12-16cs2cs: add --no-ballpark and --accuracy optionsEven Rouault
2020-12-16Fix typos in resource_files.rstGuillaume Lostis
2020-12-15proj_create_crs_to_crs_from_pj(): add ACCURACY and ALLOW_BALLPARK optionsEven Rouault
2020-12-15projinfo: add a --accuracy option to define the minimum accuracyEven Rouault
2020-12-15proj_trans_array(): make it transform all coordinates even when an error occursEven Rouault
2020-12-15Doc: document error codes and proj_context_errno_string()Even Rouault
2020-12-11funtions.rst: fix sphynx syntaxEven Rouault
2020-12-09Doc: fix return data type of proj_trans_array()Even Rouault
2020-12-08Update isea.rstZac Miller
Clarifying defaults for ISEA.
2020-12-02cs2cs / proj_create_crs_to_crs_from_pj(): add a --authority switch to ↵Even Rouault
control where coordinate operations are looked for (fixes #2442)
2020-12-02Add build time option to make PROJ_LIB env var tested last (fixes #2399)Even Rouault
If PROJ is built with the PROJ_LIB_ENV_VAR_TRIED_LAST CMake option / --enable-proj-lib-env-var-tried-last configure switch, then the hard-wired path ($prefix/share/proj) will be tried before looking at the environment PROJ_LIB.
2020-12-02Merge pull request #2444 from rouault/topocentricEven Rouault
Add +proj=topocentric geocentric->topocentric conversion (fixes #500)
2020-11-30Merge pull request #2466 from rouault/fix_2423Even Rouault
cs2cs: add --area and --bbox options to restrict candidate coordinate operations (fixes #2423)
2020-11-29Merge pull request #2450 from rouault/setAllowEllipsoidalHeightAsVerticalCRSEven Rouault
Add option to allow export of Geographic/Projected 3D CRS in WKT1_GDAL
2020-11-28cs2cs: add --area and --bbox options to restrict candidate coordinate ↵Even Rouault
operations (fixes #2423)
2020-11-26Merge pull request #2403 from kbevers/remove-proj_api.hKristian Evers
Remove proj_api.h
2020-11-24Add option to allow export of Geographic/Projected 3D CRS in WKT1_GDALEven Rouault
as CompoundCRS with a VerticalCRS being an ellipsoidal height, which is not conformant. But needed for LAS 1.4 that only supports WKT1
2020-11-23Add +proj=topocentric geocentric->topocentric conversion (fixes #500)Even Rouault
2020-11-20Update utm.rstNomit Rawat
Typo
2020-11-20Remove proj_api.hKristian Evers
Removes proj_api.h from the public API. The contents of the header file has been moved to proj_internal.h verbatim and any references to proj_api.h has been changed to proj_internal.h. The documentation of proj_api.h has been removed. The only exception to this is the API migration guides which still mention the old API. Fixes #837
2020-11-10cct: allow @filename syntaxEven Rouault
Similarly as for projinfo, allow "cct @filename" to mean read filename and use its content as if it was provided inline. Useful for WKT or PROJJSON And a tiny improvements, when the object definition contains ':', only try proj_create_from_database() if the left part (authority name) matches a known authority, to avoid a warning.
2020-11-10cct.rst: fix indentationEven Rouault
2020-11-10Allow cct to instantiate operations via object codes or names (#2419)Kristian Evers
Running cct like cct EPSG:8366 or cct "ITRF2014 to ETRF2014 (1)" is now possible.
2020-11-04docs/Makefile: restore custom 'html' targetEven Rouault
Fixes #2408 https://github.com/OSGeo/PROJ/pull/2377 removed our customized 'html' and .doxygen_up_to_date targets. Let's restore them
2020-11-03Correct links to github issues in release notes from 7.1.0 to 7.2.0Martin Steinisch
2020-11-01Merge pull request #2371 from rouault/epsg10_part2Even Rouault
EPSG v10 update part 2: ingest DatumEnsemble from the database
2020-11-01projinfo / createObjectsFromName(): support returning a datum ensembleEven Rouault
2020-11-01Merge pull request #2397 from cffk/merc-updateCharles Karney
Update Mercator projection, more accurate, faster
2020-11-01Switch website 'edit on GitHub' to 7.2 branchKristian Evers
2020-11-01Update version numbers in preparation for 8.0.0 releaseKristian Evers
2020-11-01Update docs for 7.2.0 releaseKristian Evers
2020-10-26Update Mercator projectionCharles Karney
Introduction ------------ The existing formulation for the Mercator projection is "satisfactory"; it is reasonably accurate. However for a core projection like Mercator, I think we should strive for full double precision accuracy. This commit uses cleaner, more accurate, and faster methods for computing the forward and inverse projections. These use the formulation in terms of hyperbolic functions that are manifestly odd in latitude psi = asinh(tan(phi)) - e * atanh(e * sin(phi)) (phi = latitude; psi = isometric latitude = Mercator y coordinate). Contrast this with the existing formulation psi = log(tan(pi/4 - phi/2)) - e/2 * log((1 + e * sin(phi)) / (1 - e * sin(phi))) where psi(-phi) isn't exactly equal to -psi(phi) and psi(0) isn't guaranteed to be 0. Implementation -------------- There's no particular issue implementing the forward projection, just apply the formulas above. The inverse projection is tricky because there's no closed form solution for the inverse. The existing code for the inverse uses an iterative method from Snyder. This is the usual hokey function iteration, and, as usual, the convergence rate is linear (error reduced by a constant factor on each iteration). This is OK (just) for low accuracy work. But nowadays, something with quadratic convergence (e.g., Newton's method, number of correct digits doubles on each iteration) is preferred (and used here). More on this later. The solution for phi(psi) I use is described in my TM paper and I lifted the specific formulation from GeographicLib's Math::tauf, which uses the same underlying machinery for all conformal projections. It solves for tan(phi) in terms of sinh(psi) which as a near identity mapping is ideal for Newton's method. For comparison I also look at the approach adopted by Poder + Engsager in their TM paper and implemented in etmerc. This uses trigonometric series (accurate to n^6) to convert phi <-> chi. psi is then given by psi = asinh(tan(chi)) Accuracy -------- I tested just the routines for transforming phi <-> psi from merc.cpp and measured the errors (converted to true nm = nanometers) for the forward and inverse mapping. I also included in my analysis the method used by etmerc. This uses a trigonometric series to convert phi <-> chi = atan(sinh(psi)), the conformal latitude. forward inverse max rms max rms old merc 3.60 0.85 2189.47 264.81 etmerc 1.82 0.38 1.42 0.37 new merc 1.83 0.30 2.12 0.31 1 nm is pretty much the absolute limit for accuracy in double precision (1 nm = 10e6 m / 2^53, approximately), and 5 nm is probably the limit on what you should routinely expect. So the old merc inverse is considerably less accurate that it could be. The old merc forward is OK on accuracy -- except that if does not preserve the parity of the projection. The accuracy of etmerc is fine (the truncation error of the 6th order series is small compared with the round-off error). However, situation reverses as the flattening is increased. E.g., at f = 1/150, the max error for the inverse projection is 8 nm. etmerc is OK for terrestrial applications, but couldn't be used for Mars. Timing ------ Here's what I get with g++ -O3 on various Linux machines with recent versions of g++. As always, you should take these with a grain of salt. You might expect the relative timings to vary by 20% or so when switching between compilers/machines. Times per call in ns = nanoseconds. forward inverse old merc 121 360 etmerc 4e-6 1.4 new merc 20 346 The new merc method is 6 times faster at the forward projection and modestly faster at the inverse projection (despite being more accurate). The latter result is because it only take 2 iterations of Newton's method to get full accuracy compared with an average of 5 iterations for the old method to get only um accuracy. A shocking aspect of these timings is how fast etmerc is. Another is that forward etmerc is streaks faster that inverse etmerc (it made be doubt my timing code). Evidently, asinh(tan(chi)) is a lot faster to compute than atan(sinh(psi)). The hesitation about adopting etmerc then comes down to: * the likelihood that Mercator may be used for non-terrestrial bodies; * the question of whether the timing benefits for the etmerc method would be noticeable in a realistic application; * need to duplicate the machinery for evaluating the coefficients for the series and for Clenshaw summation in the current code layout. Ripple effects ============== The Mercator routines used the the Snyder method, pj_tsfn and pj_phi2, are used in other projections. These relate phi to t = exp(-psi) (a rather bizarre choice in my book). I've retrofitted these to use the more accurate methods. These do the "right thing" for phi in [-pi/2, pi/2] , t in [0, inf], and e in [0, 1). NANs are properly handled. Of course, phi = pi/2 in double precision is actually less than pi/2, so cos(pi/2) > 0. So no special handling is needed for pi/2. Even if angles were handled in such a way that 90deg were exactly represented, these routines would still "work", with, e.g., tan(pi/2) -> inf. (A caution: with long doubles = a 64-bit fraction, we have cos(pi/2) < 0; and now we would need to be careful.) As a consequence, there no need for error handling in pj_tsfn; the HUGE_VAL return has gone and, of course, HUGE_VAL is a perfectly legal input to tsfn's inverse, phi2, which would return -pi/2. This "error handling" was only needed for e = 1, a case which is filtered out upstream. I will note that bad argument handling is much more natural using NAN instead of HUGE_VAL. See issue #2376 I've renamed the error condition for non-convergence of the inverse projection from "non-convergent inverse phi2" to "non-convergent sinh(psi) to tan(phi)". Now that pj_tsfn and pj_phi2 now return "better" results, there were some malfunctions in the projections that called them, specifically gstmerc, lcc, and tobmerc. * gstmerc invoked pj_tsfn(phi, sinphi, e) with a value of sinphi that wasn't equal to sin(phi). Disaster followed. I fixed this. I also replaced numerous occurrences of "-1.0 * x" by "-x". (Defining a function with arguments phi and sinphi is asking for trouble.) * lcc incorrectly thinks that the projection isn't defined for standard latitude = +/- 90d. This happens to be false (it reduces to polar stereographic in this limit). The check was whether tsfn(phi) = 0 (which only tested for the north pole not the south pole). However since tsfn(pi/2) now (correctly) returns a nonzero result, this test fails. I now just test for |phi| = pi/2. This is clearer and catches both poles (I'm assuming that the current implementation will probably fail in these cases). * tobmerc similarly thinks that phi close to +/- pi/2 can't be transformed even though psi(pi/2) is only 38. I'm disincline to fight this. However I did tighten up the failure condition (strict equality of |phi| == pi/2). OTHER STUFF =========== Testing ------- builtins.gei: I tightened up the tests for merc (and while I was about it etmerc and tmerc) to reflect full double precision accuracy. My test values are generated with MPFR enabled code and so should be accurate to all digits given. For the record, for GRS80 I use f = 1/298.2572221008827112431628366 in these calculations. pj_phi2_test: many of the tests were bogus testing irrelevant input parameters, like negative values of exp(-psi), and freezing in the arbitrary behavior of phi2. I've reworked most for the tests to be semi-useful. @schwehr can you review. Documentation ------------- I've updated merc.rst to outline the calculation of the inverse projection. phi2.cpp includes detailed notes about applying Newton's method to find tan(phi) in terms of sinh(psi). Future work ----------- lcc needs some tender loving care. It can easily (and should) be modified to allow stdlat = +/- 90 (reduces to polar stereographic), stdlat = 0 and stdlat_1 + stdlat_2 = 0 (reduces to Mercator). A little more elbow grease will allow the treatment of stdlat_1 close to stdlat_2 using divided differences. (See my implementation of the LambertConformalConic class in GeographicLib.) All the places where pj_tsfn and pj_phi2 are called need to be reworked to cut out the use of Snyder's t = exp(-psi() variable and instead use sinh(psi). Maybe include the machinery for series conversions between all auxiliary latitudes as "support functions". Then etmerc could use this (as could mlfn for computing meridional distance). merc could offer the etmerc style projection via chi as an option when the flattening is sufficiently small.
2020-10-25Add +proj=col_urban projection, implementing a EPSG projection method used ↵Even Rouault
by a number of projected CRS in Colombia (fixes #589)
2020-10-25Fix typos spotted by scripts/fix_typos.shEven Rouault
2020-10-23Minor fixes to tmerc documentationCharles Karney
2020-10-23merc.rst: change "origins from 15th cent" to 16th cent.Charles Karney
2020-10-22merc.rst: revert to ln instead of log.Charles Karney
Also define merc (resp. tmerc) as the conformal projection in which the equator (resp. a chosen meridan} projects to a straight line at constant scale.
2020-10-22Flesh out the documentation for MercatorCharles Karney
This addresses item 1 in issue #2387 Things to note: * I made "editorial" changes to the text. The virtues and vices of Mercator are a hot topic. So check these out. (I judged that the text I replaced to be pretty misleading.) * I include the radius of the sphere/ellipsoid in the formulas (and I did this also for my mods for tmerc documentation). Surely this is better than leaving the reader to figure out how this is introduced. * I include the "old-style" (ca 18th century) formulas and the newer ones in terms of hyperbolic functions. The former may be the familiar ones, but the latter are better for computation (more succinct, more accurate, faster, preserve parity). * For the inverse ellipsoidal transformation, I just say that the formula for psi is inverted iteratively. This is probably sufficient, but it could be expanded later.
2020-10-19C API: add proj_context_clone() (#2383)Alan D. Snow
Fixes #2382
2020-10-18Document the default poder_engsager algorithm for tmerc. (#2379)Charles Karney
* Document the default poder_engsager algorithm for tmerc. * Give exact expression for phi' in terms of phi * Aadd another datapoint on range of applicability + explanation for complex numbers. * Update tmerc figure with one reflecting poder/engsager algo. Courtesy of @hobu. Co-authored-by: Charles Karney <charles.karney@sri.com>
2020-10-16projinfo.rst: fix typoEven Rouault
2020-10-16Add multi-line PROJ string export capability, and use it by default in ↵Even Rouault
projinfo (unless --single-line is specified) (fixes #1543)