aboutsummaryrefslogtreecommitdiff
path: root/src/geodesic.c
AgeCommit message (Collapse)Author
2021-06-22Minor changes to address lint in geodesic.c (courtesy of Marc Emery ↵Charles Karney
<memery@myotest.com>)
2021-03-14geodesic.c: fix conditions under which hypot workaround is applied.Charles Karney
Now it applies with 32-bit compiles for all versioins of Visual Studio; versions tested on: 2015, 2017, 2019.
2021-03-13Work around inaccurate hypot for Visual Studio 2105 (32-bit)Charles Karney
2021-03-13Update geodesic routines from GeographicLib 1.52Charles Karney
Be more aggressive in preventing negative s12 and m12 for short lines. Initialize reference argument to remquo.
2020-11-24Sync w GeographicLib 1.51. Remove C99 compatibility functions. (#2445)Charles Karney
Should be no changes in the compiled code.
2019-10-01Fix some Cppcheck complaints in geodesic routinesCharles Karney
2019-09-22Update to version 1.50 of the geodesic library.Charles Karney
* Allow arbitrarily complex polygons in geod_polygon_*. In the case of self-intersecting polygons the area is accumulated "algebraically", e.g., the areas of the 2 loops in a figure-8 polygon will partially cancel. * Simplify code by using C99 functions remainder and remquo. * More test coverage. Fixes to associated files: * src/pipeline.cpp invoke geod_init with f = es / (1 + sqrt(1 - es)) instead of (the less accurate) f = 1 - sqrt(1 - es) * src/apps/geod_set.cpp remove "#undef f" (a dangling relic?).
2019-09-19Require C99 compiler see #1621Charles Karney
cmake and autoconf now stipulate C99 change c89 to c99 in travis jobs remove HAVE_C99_MATH checks (unrelated) relax Visual Studio compatibility check in cmake/project-config-version.cmake.in (VS 2019 can use a VS 2015 library but not vice versa).
2019-09-18Get rid of dead code. The end result of this chain of commits is toCharles Karney
eliminate most of math.cpp. All that is left is the handling of isnan (and I've this because math.cpp notes that gie.c uses pj_isnan). geodesic.c now handles supplying C99 math functions internally and this can go away once C99 support is mandated.
2019-09-18Let geodesic.c use its own versions of C99 math functions if necessary.Charles Karney
2019-09-17Fix typo in geodesic.cCharles Karney
2019-09-17Add atanh, copysign, cbrt, remainder, remquo to math.cpp.Charles Karney
The supported C99 math functions provided by math.cpp are thus hypot log1p asinh atanh copysign cbrt remainder remquo round lround Make compiler checks in CMakeLists.txt and configure.ac consistent with this set. Make geodesic.c use the math.cpp defined (instead of the internally defined) versions of hypot atanh copysign cbrt This is keyed off the presence of the PROJ_LIB macro. I had at one time https://github.com/OSGeo/PROJ/pull/1425 suggested supplying an additional macro PROJ_COMPILATION when compiling geodesic.c. However, PROJ_LIB seems to fill the bill OK. The *next* version of geodesic.c (due out in a few weeks) will also use remainder remquo All of this is only of concern for C compilers without C99 support. So this may become an historical footnote at some point.
2018-12-26cpp conversion: revert geodesic.cpp to geodesic.cEven Rouault
2018-12-26cpp conversion: minimal steps to fix compilation errors, not warningsEven Rouault
2018-05-30Fix warnings found by clang with new warning flags to be added in later commitEven Rouault
Fixes consist in: - no use of comma operator for multi statement purpose - avoid confusing comma in for loops first and third clauses - avoid implicit long to int casts by storing to long, or explicit bound checking before cast
2018-05-07Clean readability-inconsistent-declaration-parameter-name clang-tidy warningsKristian Evers
2018-04-23Add isnan() to proj_math.hKristian Evers
Code updated to use isnan() instead of pj_is_nan().
2018-04-16Prefer proj_math.h over math.h when geodesic.c is compiled as part of PROJKristian Evers
2018-03-23geodtest: introduce assertNaN. geodesic: comment on non-use of pj_is_nan.Charles Karney
2018-03-17Fix comments in geodesic.c. Better invocation of AX_CHECK_COMPILE_FLAG,Charles Karney
but I doubt this will fix the build failures on the CI machines.
2018-03-17Patch 1.49.3 for geodesic package.Charles Karney
Set flags for Intel compiler to prevent incorrect optimization of arithmetic expressions #826. Guard against nans in sincosdx #834. Issue #831 is not addressed here (need more information...).
2018-03-14Fix (mostly false positive) clang static analyzer warnings about potential ↵Even Rouault
null pointer dereference
2018-03-14geodesic.c: initialize various variables to please CLang Static AnalyzerEven Rouault
2018-03-14Add a few cppcheck suppressionsEven Rouault
2018-03-12geodesic.c: fix multiple occurences of 'Clarify calculation precedence for ↵Even Rouault
'&' and '?'' cppcheck warnings
2018-02-23Add tests to improve the code coverage.Charles Karney
Now all of geodesic.c is covered except for 3 lines (and 2 of these are intentionally dead code). This corresponds to tag v1.49.2-c in the GeographicLib code base. While testing polygons which encircle the globe multiple times, I uncovered a problem where the range of the area was not reduced to the allowed range (either [0, area0) or (-area0/2, area0/2]) correctly. Since the documentation explicity restricted the calculation of polygon areas to simple polygons, we'll defer fixing this for now. (However the intention was always to handle the area "algebraically" so that, for example, a "bowtie" has zero area. So I will plan on fixing this for 1.50.) Update copyright dates + NEWS.
2018-02-22Fix issue #812Charles Karney
Implement Polygon AddEdge fix in C library (will be version 1.49.2 of C library for proj 5.0.0). Still to do: add tests to expand code coverage. This will only affect geodtest.c which is not part of the compiled library.
2017-12-18Fix issue #715. Merge 1.49.1 of geodesic library (tagged as v1.49.1-cCharles Karney
in GeographicLib). Details: Workaround bugs in handling of -0.0 in fmod and sin in Visual Studio 10, 11, and 12. Relax unrealistically strict delta for GeodSolve59 in geodtest.
2017-08-29Release candidate for geodesic library version 1.49.Charles Karney
Only substantial changes are (1) testing the HAVE_C99_MATH flag and acting accordingly and (2) adding a couple of tests.
2017-04-10geodesic.c: fix compiler error, if (x) -> if (x != 0)Charles Karney
2017-04-09Merge is geodesic routines from GeographicLib 1.48. Changes:Charles Karney
- http://geographiclib.sf.net -> http://geographiclib.sourceforge.io - backport fixes for warnings messages from some compilers - change default range for longitude and azimuth to (-180d, 180d] (instead of [-180d, 180d))
2017-02-28Enable cppcheck and fix related mostly false-positive warningsEven Rouault
2017-02-26Typo fixesEven Rouault
2017-02-15Issue #490 update from geodesic routines from GeographicLib 1.47.Charles Karney
Improve accuracy of area calculation (fixing a flaw introduced in version 1.46). Changed files geodesic.[ch3], geodtest.c, geod.1.
2016-12-12Add a scripts/fix_typos.sh script and correct reported errorsEven Rouault
2016-02-15geodesic.c: move declarations to beginings of functions.Charles Karney
2016-02-15Upgrade geodesic library from GeographicLib 1.46.Charles Karney
* upgrade geodesic.[ch3] * add test suite geodtest.c and invoke via cmake's add_test * increment version to 4.9.3 and library version to 11.0.0
2015-08-16Drop in the latest geodesic library from GeographicLib (version 1.44).Charles Karney
http://geographiclib.sourceforge.net/1.44/C/index.html The changes are: - Improve accuracy of calculations by evaluating trigonometric functions more carefully and replacing the series for the reduced length with one with a smaller truncation error. - The allowed ranges for longitudes and azimuths is now unlimited; it used to be [-540d, 540d). - Enforce the restriction of latitude to [-90d, 90d] by returning NaNs if the latitude is outside this range. - The inverse calculation sets s12 to zero for coincident points at pole (instead of returning a tiny quantity). This commit also includes a work-around for an inaccurate value for pi/180 in dmstor.c (see the definitions of DEG_IN and DEG_OUT in geod_interface.c).
2015-06-28geodesic.c: Fix 'ISO C90 forbids mixed declarations and code' warning in GCC ↵Even Rouault
< 4.6 case
2015-05-20Update to version 1.43 of the geodesic routines. This fixes twoCharles Karney
relatively obscure problems. (1) The business of returning an unrolled longitude with the solution to the direct problem was broken for west-going geodesics. (2) For flattening > 1/100, a slight inaccurate result was returned for a12 in the direct calculation. git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2656 4e78687f-474d-0410-85f9-8d5e500ac6b2
2015-02-09Fix NaN handling by geod_inverse and incorrect area computation by ↵Even Rouault
geod_polygon_addedge if the longitude extent of the added edge exceeds 180 degrees (patch by Charles Karney, #251, #253) git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2600 4e78687f-474d-0410-85f9-8d5e500ac6b2
2013-07-12allow polygon vertices to be specified incrementally for geodesic area (#221).Frank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2377 4e78687f-474d-0410-85f9-8d5e500ac6b2
2013-06-23sync up with what will be GeographicLib 1.31 (#216)Frank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2353 4e78687f-474d-0410-85f9-8d5e500ac6b2
2013-05-10Major upgrade to geodesic support from Charles Karney (#197). Frank Warmerdam
Syncs geodesic routines with GeographicLib. Adds geodesic.3 man page. geod_* api exposed publically. geodesic.h is installed. git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2333 4e78687f-474d-0410-85f9-8d5e500ac6b2
2012-12-07replacement of geodesic engine with one from Charles Karney (#197)Frank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2297 4e78687f-474d-0410-85f9-8d5e500ac6b2