aboutsummaryrefslogtreecommitdiff
path: root/src/pj_transform.c
AgeCommit message (Collapse)Author
2018-09-23Fix mistakes in function commentsIvan Veselov
2018-08-294D API: honour vto_meter / vunits for proj=longlatEven Rouault
This worked for cs2cs / pj_transform(), but not the new API
2018-08-19pj_transform / cs2cs: honour +geoc flagEven Rouault
2018-06-21Add support for deg, rad and grad in unitconvert (fixes #1052), and document ↵Even Rouault
that it supports numeric factors (refs #1053)
2018-06-19pj_transform.c:projected_to_geographic: Convert literal -17 to ↵Kurt Schwehr
PJD_ERR_NON_CONV_INV_MERI_DIST (#993)
2018-06-04pj_transform.c: Use errno symbols, not numeric literals (#1029)Kurt Schwehr
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-15IWYU: Partial PJ_natearth.c..rtodms.cKurt Schwehr
2018-05-07Clean readability-inconsistent-declaration-parameter-name clang-tidy warningsKristian Evers
2018-05-04Convert errno literals to corresponding PJD symbolKurt Schwehr
2018-04-25pj_transform: reset error state before each call to pj_inv/pj_fwdEven Rouault
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.
2018-03-11Remove 'pj_' prefix from static functionsKristian Evers
Functions should only be prefixed with 'pj_' when they can be used in other parts of the code base and not just within a single file. Takes care of the last step in #675.
2018-03-09Repair PR #845: Scale vertical coords properly. (#848)Thomas Knudsen
Thanks to Bas Couwenberg <sebastic@debian.org> for spotting this horrible bug!
2018-03-09Refactor pj_transform, reintroduce support for vertical scaling (#845)Thomas Knudsen
* Refactor pj_transform, reintroduce support for vertical scaling
2018-03-01Revert fix to #22Kristian Evers
The fix in #22 solved the problem at hand and doing what was expected from the specified parameters. Unfortunately it also removed the slightly hacky "feature" that makes the web mercator work in pj_transform. The web mercator is special since the latitude is computed on the ellipsoid, but behaves as if if was defined on a sphere. Hence it is problematic to change the ellipsoid parameters when using the web mercator, even though that is the geodetically correct thing to do. The web mercator is used in more or less any web mapping application and is thus one of the most frequently used transformations in PROJ. This justifies re-introducing the minor bug reported in #22. The problem will have to be taken care of properly when pj_transform is removed from the library in favour of the transformation pipelines based API.
2018-01-25Fix null pointer dereference in pj_datum_tranform() caused by ↵Even Rouault
d0dbf48438f9e152314abf294467cb54f9ae0e70 changes. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5649. Credit to OSS Fuzz
2018-01-23Handle ellipsoid parameters correctly when using +nadgrids=@null. Fixes #22.Kristian Evers
Make sure to not change ellipsoid parameters to WGS84 when applying the null grid. Coordinates will still refer to the input ellipsoid so we keep the original parameters which in turn will be used when the coordinates are transformated to/from cartesian/geocentric space. Adjusted regression test material in nad/proj_outIGNF.dist slightly to accomodate numerical differences at the mm level. The transformations in question are at best accurate to about 1m so this shouldn't change real world usage of these transformations.
2018-01-03Introduce preparation/finalization steps in fwd/inv subsystem, supporting ↵Thomas Knudsen
arbitrary dimensionality in test code * Call trans func of same dimensionality as input in gie * Refactor prep/fin code for pj_fwd/pj_inv 2D,3D,4D * Remove prime meridian handling from pj_transform (now handled in pj_fwd_prepare/pj_inv_finalize) * Introduce prep/fin skips, mostly in support of axisswap and pipeline drivers * Refactor fwd/inv subsystem * pj_transform: Let pj_fwd/inv handle scaling * Let pj_fwd/inv3d fall back to 2D eventually
2017-11-23Add description for PJD_ERR_INVALID_ARGThomas Knudsen
2017-10-06Enable default destructor for all PJ objects.Thomas Knudsen
In most cases memory deallocation is completely removed from the code since it can be handled by the default destructor. In a few special cases a local destructor overrides the default destructor and makes sure that locally allocated memored is cleaned up correctly. Move all deallocation from pj_free to pj_default_destructor Rename pj_latlong.c to fit with the conventional format PJ_latlong.c - freeup was missed here due to wrong naming Clean up pj_init to avoid double deallocation; Also resolve #576 by adding z_0 and t_0 options in pj_init, while cleaning Add a prototype for dealloc_params Added missing errno.h include in pj_ctx.c Temporarily removing ob_tran from testvarious, to be sure that is where the trouble is Make PJ_ob_tran.c use proper initialization for the chained projection proj=ob_tran: make it clear, that we disallow ellipsoidal projections, and, for improved backwards compatibility, turns off default settings, which could inject unwanted ellipsoid definitions ... then also remove the ellipsoid definition from the testvarious test case - which is probably buggy anyway Work around cs2cs spherical init bug in testvarious; Forbid defs for ob_tran in pj_init
2017-05-29pj_compare_datums(): fix null pointer dereference.Even Rouault
Can happen when any of the src/dest projection has a +catalog parameter. Fix a memory leak on catalog_name as well. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1799 Credit to OSS Fuzz
2017-05-23pj_transform(): fix segfault when z == NULL and dest defn has a fwd3dEven Rouault
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1794 Credit to OSS Fuzz
2017-05-23Avoid potentially very long loop when normalizing longitudes around ↵Even Rouault
long_wrap_center Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1809 Credit to OSS Fuzz
2017-03-08Fix commentEven Rouault
2017-02-26Fix warnings related to -Wshadow -Wnull-dereference -Wfloat-conversionr ↵Even Rouault
-Wmissing-prototypes -Wmissing-declarations
2017-02-25Fix GCC 7 warnings related to misleading indentations, fallthrough cases and ↵Even Rouault
unused variable
2016-12-12Add a scripts/fix_typos.sh script and correct reported errorsEven Rouault
2016-05-28Change math constants, similar to PR #372. Use M_ namespace with the de ↵Micah Cochran
facto standard M_PI and its ilk. Change names that are widely used in the project to be in the M_ namespace, so HALFPI becomes M_HALFPI. HALFPI is #defined as M_PI_2 (the defacto standard name). #defines _USE_MATH_DEFINES for MS Visual Studio (I didn't personally test this part, but Appveyor will not build otherwise).
2016-05-11Portability cleanups for the code in PR #6 (and a few additional source files)Thomas Knudsen
Eliminated mixed code and declarations, converted C++ style comments and probably did a few more things highlighted by running gcc with the "-W -Wall -Wextra -pedantic" flags
2015-10-23- API Extension to include fwd3d / inv3dPiyush Agram
- New SCH coordinate system for radar imaging systems
2015-08-25pj_transform(): fix crash with z == NULL if vertical grid shift is required ↵Even Rouault
(#292)
2015-05-31Remove unused $Id$ keywords.Elliott Sales de Andrade
2011-05-10add support for vunits/vto_meter parameters to specify vertical unitsFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2000 4e78687f-474d-0410-85f9-8d5e500ac6b2
2010-09-20fix vgrid inverse and error handlingFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1904 4e78687f-474d-0410-85f9-8d5e500ac6b2
2010-06-11roll projCtx through various other low level functionsFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1856 4e78687f-474d-0410-85f9-8d5e500ac6b2
2010-06-11preliminary implementation of projCtx APIFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1854 4e78687f-474d-0410-85f9-8d5e500ac6b2
2010-05-11preliminary addition of vertical datum shifting capabilityFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1839 4e78687f-474d-0410-85f9-8d5e500ac6b2
2010-03-16Rework the translation of nadgrids parameters into a list of gridshift files Frank Warmerdam
to avoid use of static "lastnadgrids" information which screws up multithreading. Changes the PJ structure. git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1831 4e78687f-474d-0410-85f9-8d5e500ac6b2
2010-03-03various improvements to error handling so corrupt grids are reported (#66)Frank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1828 4e78687f-474d-0410-85f9-8d5e500ac6b2
2010-03-01added preliminary support for +axis (#18)Frank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1825 4e78687f-474d-0410-85f9-8d5e500ac6b2
2010-01-24fix seriously broken lon_wrap support (#62)Frank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1789 4e78687f-474d-0410-85f9-8d5e500ac6b2
2009-01-06removed CVS log messages since they are not maintained by subversionFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1504 4e78687f-474d-0410-85f9-8d5e500ac6b2
2007-12-03Improve WGS84 ES precision to avoid unnecesary transformation (#1531)Frank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1414 4e78687f-474d-0410-85f9-8d5e500ac6b2
2007-11-26Modified PJ structure to hold a_orig, es_orig, ellipsoid definition beforeFrank Warmerdam
adjustment for spherical projections. Modified pj_datum_transform() to use the original ellipsoid parameters, not the ones adjusted for spherical projections. Modified pj_datum_transform() to not attempt any datum shift via geocentric coordinates if the source *or* destination are raw ellipsoids (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1406 4e78687f-474d-0410-85f9-8d5e500ac6b2
2007-09-11mark the transient error array constFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1404 4e78687f-474d-0410-85f9-8d5e500ac6b2
2007-09-11avoid use of static variables to make reentrantFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1403 4e78687f-474d-0410-85f9-8d5e500ac6b2
2006-10-12Added experimental +lon_wrap argument to set a "center point" forFrank Warmerdam
longitude wrapping of longitude values coming out of pj_transform(). git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1353 4e78687f-474d-0410-85f9-8d5e500ac6b2
2006-05-10Don't apply to_meter in pj_transform() if the value is HUGE_VAL.Frank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1336 4e78687f-474d-0410-85f9-8d5e500ac6b2
2006-05-01make out of range errors in geodetic to geocentric a transient errorFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1335 4e78687f-474d-0410-85f9-8d5e500ac6b2
2006-03-20pj_geodetic_to_geocentric returns -14 now for lat out of rangeFrank Warmerdam
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1326 4e78687f-474d-0410-85f9-8d5e500ac6b2