aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-01-11Fix breakage of previous commitEven Rouault
2018-01-11PJ_axisswap.c: validate axis value. Fixes ↵Even Rouault
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5073. Credit to OSS Fuzz. master only
2018-01-09Remove or use unused macrosAaron Puchert
Some macros seemed to be leftover from earlier code, so I removed them. Others seemed like they should have been used, but weren't. There should be no functional change, except the following: in floating- point arithmetic, x / y is not the same as x * (1.0 / y). It can be argued that using the multiplication is significantly faster, and the algorithm is approximative anyway. Otherwise, the constants are obviously not required. Also fixes one location in PJ_aitoff.c, where an enumeration value should have been used.
2018-01-08Allow usage of classic +axis parameter in axisswap.Kristian Evers
Instead of +order the classic PROJ.4 parameter +axis can used instead. This is mostly an inititive to simplify backwars compatibility in the 4D API. P->axis is initialized in pj_init() it can be assumed that it is set up correctly. +order and +axis are mutually exclusive.
2018-01-08Discern between 2D projected and 3D cartesian linear units (#732)Thomas Knudsen
2018-01-06Remove unused typedef from pj_init.cThomas Knudsen
2018-01-06Remove superfluous self-assignment in phi12Thomas Knudsen
2018-01-06Repair ratio numbers for units in pj_init_ctxThomas Knudsen
2018-01-06Eliminate potential zero-dereference in get_init.Thomas Knudsen
2018-01-05Custom unit factors in unitconvert.Kristian Evers
Added the possibility to use custom unit factors. Similar to the classic +to_meter parameter the conversion factor is related to meters, i.e. the factor for conversion from kilometers meters is 1000. The custom unit factors is given using the existing xy_in, xy_out, z_in and z_out parameters, for example: proj=unitconvert xy_in=4.5 +xy_out=mm
2018-01-05Avoid overwriting time component with zeroKristian Evers
2018-01-04Bar step-internal params from influencing pipeline driver init (#729)Thomas Knudsen
In cases such as: proj=pipeline step proj=utm zone=32 ellps=GRS80 ... The pj_init code would pick up the ellps information (and other material such as false eastings and northings) from the utm step and place it into the PJ object of the pipeline driver. This is not the intention, and is eliminated in this PR by terminating parameter searching (done by pj_param) once a step parameter is reached.
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-12-20Merge pull request #724 from busstoptaktik/repair-cct-columnsThomas Knudsen
Repair column selector bug Fixes #723
2017-12-20Repair column selector bugThomas Knudsen
2017-12-20Merge pull request #722 from kbevers/divide-by-zero-cconKristian Evers
Avoid zero-division in ccon.
2017-12-20Avoid zero-division in ccon.Kristian Evers
Credit to OSS-Fuzz. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4695
2017-12-19Danish (Andrae) ellipsoid, and Copenhagen meridian introduced in support of ↵Thomas Knudsen
the Reykjavik 1900 datum (Iceland)
2017-12-19Add missing call to pj_chomp, in order to remove inline comments (#720)Thomas Knudsen
Previously, when expanding init=foo.bar calls, pj_chomp was first called after collecting all lines, effectively discarding everything after the start of the first comment
2017-12-19Some corrections in response to a review by Kristian Evers (#718)Thomas Knudsen
* Some corrections in response to a review by Kristian Evers
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-12-18Remove superfluous element free_format from OPTARGPM object (#716)Thomas Knudsen
Fixes #699
2017-12-18Merge pull request #674 from aaronpuchert/const-globalsEven Rouault
Declare non-local variables as const where possible
2017-12-18Enable wildcard globbing for MSVC builds (#714)Thomas Knudsen
* Enable wildcard globbing for MSVC builds * Use globbing to run all gie tests * Despite merge title: Also use wildcards on gie tests when using GNU compilers
2017-12-17Declare non-local variables as const where possibleAaron Puchert
Having non-const variables of static lifetime or even global scope is usually a bad idea. These variables are inherently constants, and this should be enforced. This required marking some functions as not modifying input parameters and marking some pointers as pointers to const. One advantage is that the compiler usually puts const static variables in a read-only code segment, so they can't be modified physically. This can be verified with `nm` (on POSIX systems). To avoid changes to the public API, functions returning non-const pointers to data tables were left intact, but the returned data may not be modified. Internally we prefer using the proj_list_* functions over the pj_get_*_ref functions, because the former return const pointers.
2017-12-17Merge pull request #713 from kbevers/travis-c89Kristian Evers
Add -std=c89 to travis targets
2017-12-17Add -std=c89 to travis targets.Kristian Evers
The multistresstest code has been made C89 compliant in the process.
2017-12-17Normalize whitespace in multistresstest.cKristian Evers
2017-12-17Free format everywhere (#693)Thomas Knudsen
* Free format now in cmd lines, in gie, and in init files * Corrected handling of defaults * Add demo of integrated definition and validation * Repair stack-smashing memmove in get_init * repair paralist corruption, clean up debug output * Install test files for nmake builds * Add many improvements following suggestions by @schwehr * Be consistent in requiring lower case everywhere in gie.c Also, this Fixes #703 and Fixes #697
2017-12-17Fix integer overflow in unitconvert.Kristian Evers
For sufficiently large values of modified julian date the mjd_to_yyyymmdd function would integer overflow in the calculation of the return value. This is fixed by implicit type conversion. Credit to OSS-Fuzz. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4658 and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4667
2017-12-16Merge pull request #706 from kbevers/deformation-updateKristian Evers
Updates to deformation operation.
2017-12-14Add time unit yyyymmdd to unitconvert operation (#707)Kristian Evers
Add time unit yyyymmdd to unitconvert operation
2017-12-14Updates to deformation operation.Kristian Evers
The initial approach taken in the deformation operation was not geodetically sound. The deformation model grids were required to be indexed in lat/long space with the velocities in the grids being in cartesian space. This is quite confusing and it is not a normal way of making deformation models. The usual approach is to keep everything in the east, north, up, or ENU, space. We adopt that tradition in this commit. The velocities are still applied in cartesian space which requires that the grid-velocities are converted from ENU space to cartesian space. As a consequence of this change the operation is changed so that it only works in full 3D mode. That is, both horizontal and vertical grids need to be applied. The inverse operation is changed slightly to accommodate the now fully 3D transformation. In it's present form it is a modification to the original algorithm that also includes the vertical component in the iteration. This is necessary to get a proper mapping from ENU to cartesian space in the loop. The vertical component is overwritten with the initial z-correction at the end of the loop. This approach is not completely accurate and will introduce errors, especially when doing many roundtrip calculations, but it seems to be good enough for a few roundtrips. The PJ_ENU data type is re-introduced to better communicate the what state the grid corrections are in throughout the code.
2017-12-11Allow including the new API header in proj.cAaron Puchert
This didn't work before because the elaborate type punning scheme was deactivated by including proj.h. Now we use the type punning from the new API header and build our own. This change is required for #674.
2017-12-06Use approximate equations instead of exact as default in Helmert.Kristian Evers
2017-12-06Use t_epoch and t_obs instead of epoch and tobs.Kristian Evers
Prefixing with t_ is more consistent with the existing parameters in PROJ, such as x_0 and friends. t_epoch and t_obs is already used in PJ_deformation. Now users can expect consistency across time-varying transformations.
2017-11-29Fix bad typedef that surfaces when including proj.h and proj_api.h in the ↵Kristian Evers
same file (#687) Fix bad typedef that surfaces when including proj.h and proj_api.h in the same file
2017-11-28Merge remote-tracking branch 'aaronpuchert/static-assert'Even Rouault
2017-11-28Free formatting of PROJ key=value pairsThomas Knudsen
2017-11-28Enable selective debug printout through negative PROJ_DEBUG values (#689)Thomas Knudsen
* Enable selective debug printout through negative PROJ_DEBUG values
2017-11-28Add tests for GDA2020 (#688)Thomas Knudsen
Add GDA2020 tests, and correct the PJ_helmert bug they revealed
2017-11-27Replace some asserts by compile-time assertionsAaron Puchert
Decisions regarding the size of certain types are always made at compile time, hence this is where the assertion should take place. If the assertions fail, there is now a compiler error.
2017-11-27gie support for builtin errcodes, and other improvements (#684)Thomas Knudsen
* gie support for builtin errcodes, and other improvements * allow lower case error constants
2017-11-26pj_ctx_set_debug(): avoid null pointer dereference when called with ctx == ↵Even Rouault
NULL. Found by cppcheck
2017-11-26axisswap: validate axis number. Fixes ↵Even Rouault
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4404. Credit to OSS Fuzz
2017-11-25Improve API (#683)Thomas Knudsen
Increase the focus on PJ_COORD as primary datatype: Eliminate use of PJ_TRIPLET etc. Trim proj.h by removing material that has become unnecessary. Improve constness Make proj_factors work in proj.h space, by providing a trimmed down PJ_FACTORS (which even has more meaningful field names)
2017-11-25Overhaul ellipsoid handling (#682)Thomas Knudsen
Improve error messaging for cct and gie, and do some clean ups in the ellipsoid handling - partially to squash bugs, partially to improve naming consistency which, in turn, improves the readability of the ellipsoid handling code. Renamed functions: pj_inherit_ellipsoid_defs has been renamed pj_inherit_ellipsoid_def, while pj_calc_ellps_params has been renamed pj_calc_ellipsoid_params. The code in get_opt (part of pj_init.c), which handles whether or not an ellipsoid definition should be dragged in from proj_def.dat, has been rewritten. I suspect this was buggy beforehand, and at least the new code is easier to follow (although it may be slightly slower, which is not really a problem as it sits in the setup code, and hence is executed only once).
2017-11-23Add description for PJD_ERR_INVALID_ARGThomas Knudsen
2017-11-22Merge pull request #680 from busstoptaktik/oss_fuzz-4355_rf-zeroThomas Knudsen
Avoid div-by-zero in rf setup
2017-11-22Merge pull request #679 from busstoptaktik/oss_fuzz-4369-to_meterThomas Knudsen
Avoid div-by-0 in to_meter init