aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-03-11Various typo fixesEven Rouault
2018-03-11typo fix: Rename PJD_ERR_UNKNOW_UNIT_ID as PJD_ERR_UNKNOWN_UNIT_IDEven Rouault
Original mispelled constant kept for backward compatibility.
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-11Remove angle brackets for proj headers (#849)Thomas Knudsen
* Avoid using angle brackets for PROJ headers. Switching from #include <proj.h> to #include "proj.h", and correspondingly for projects.h and proj_api.h, reduces the risk of accidentally picking up a system installed older version of the header while building a new version of PROJ. * Also handle geodesic.h
2018-03-11Merge pull request #847 from kbevers/proj_strerrnoKristian Evers
Add proj_errno_string function
2018-03-09Add proj_errno_string functionKristian Evers
Equivalent to pj_strerrno.
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-09Merge pull request #844 from kbevers/tidy-proj_transKristian Evers
Use consistent names for PJ_COORD's in declarations
2018-03-09Refactor pj_transform, reintroduce support for vertical scaling (#845)Thomas Knudsen
* Refactor pj_transform, reintroduce support for vertical scaling
2018-03-08Use consistent names for PJ_COORD's in declarationsKristian Evers
Changes use of 'PJ_COORD coo' to 'PJ_COORD coord' so that variable names in public function prototypes are consistent. Closes #842.
2018-03-06Remove angle brackets in include proj.hThomas Knudsen
The #include <proj.h> in proj_internal.h has been changed to #include "proj.h" in order to avoid accidentally including an old installed proj.h file while building a new version of libproj.
2018-03-06fix a few typos (again)Mike Toews
2018-03-05Merge pull request #832 from awulkiew/fix/parametersKristian Evers
Improve consistency of parameters
2018-03-05Merge pull request #830 from kbevers/revert-issue-22-fixKristian Evers
Revert fix to #22
2018-03-02Improve consistency of parameters in omerc and tpers projections.Adam Wulkiewicz
2018-03-01Update release date5.0.0Kristian Evers
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-02-24Relax some the tests in geodtest.Charles Karney
This attempts to address the geodtest failures noted in #819. @sebastic can you re-run your tests?
2018-02-23Don't reset errno when skipping tests.Kristian Evers
The error number should not be reset until a new instance of "operation ..." is reached. The ignore-feature initially worked by accident since pj_errno was not being reset when calling proj_errno_reset. This was fixed in #808, which subsequently caused ignored tests to fail.
2018-02-23Merge pull request #816 from cffk/geod-1.49.2Charles Karney
Fix issue #812
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.
2018-02-23Tidy a few typosMike Toews
2018-02-22gie expect: ignore unspecd dims, improve reporting/builtinsThomas Knudsen
In pipelines including a Helmert shift, we need to run the test through the 4D transformation interface, even though the input coordinate system may be 2D. This can be enforced by appending "0 0" to the 2D coordinate pair in the accept instruction, which is sufficiently recognizable to be considered an idiom for selecting 4D. On return, however, (i.e. in the expect instruction), the last dimensions will contain garbage, and this garbage will be compared with "0 0" when computing the deviation. This obviously leads to nonsensical results, which this commit repairs by zeroing all dimensions *not given* in expect, before computing the deviation. Additionally, the test tolerance for geo/cartesian roundtrip precision has been relaxed from picometer to nanometer level. These tests have shown to intermittently bomb, and as the pm level tolerance is probably a leftover from when deviation was computed in degrees, not meter (and hence a factor of 111000 more tight than intended at its introduction) relaxing it by a factor of 1000 makes ample sense. Also, two new features, introduced while debugging this case has been left in the code: - improved reporting, for verbosity levels higher than 2 - a "skip" instruction, forcing all remaining work to be skipped (i.e. run until something strange happens - then stop to handle debugging, while avoiding additional garbage)
2018-02-22horner: support westings/southings in complex caseThomas Knudsen
2018-02-19proj_errno_reset: Also reset pj_errnoRaul Marin
2018-02-13Merge pull request #789 from cffk/cmake-namespace-targetsCharles Karney
Re-do pull request #451 export CMake targets with PROJ4:: namespace
2018-02-12Ensure cs2cs emulation gets correct ellipsoid defn (#798)Thomas Knudsen
Copy ellipsoid definition for proj=cart directly into the proj_create call, rather than calling pj_inherit_ellipsoid_def afterwards. Previously, the ellipsoid definition was left out from the call. pj_init_ctx would then pick up WGS84 from proj_def.dat, and the init would succeed (and the possibly wrong ellipsoid definition would later on be overwritten with the correct values by pj_inherit_ellipsoid_def. But if PROJ_LIB was not set or proj_def.dat was inaccessible for other reasons, things went wrong.
2018-02-12Make proj_pj_info work correctly for pipelines (#795)Thomas Knudsen
Due to the slightly involved way a pipeline is set up, only a small subset of the definition parameters are directly read by the pj_init code. The remaining parameters will not get their "used" flag set, and for that reason will not be included in the projection definition element of a PJ_PROJ_INFO, returned by proj_pj_info. For now, we force the "used" flag of all elements of a pipeline to be set. The code is tested by introducing cct functionality for printing the projection definition used.
2018-02-12Avoid invalid ellps error messages from pj_init (#794)Thomas Knudsen
Reset error type PJD_ERR_MAJOR_AXIS_NOT_GIVEN for operations that do not need an ellipsoid.
2018-02-12Merge pull request #793 from busstoptaktik/pj_init_cleanupThomas Knudsen
A few repairs in and around pj_init.c
2018-02-12Repair prior attempt to default to WGS84 if explicit ellps not neededThomas Knudsen
2018-02-12a minor linguistic correctionThomas Knudsen
2018-02-12typedef some recurring function signaturesThomas Knudsen
2018-02-11Add missing ! in boolean evaluation. Fixes #780.Kristian Evers
2018-02-11Merge pull request #790 from kbevers/fix-proj_api.hKristian Evers
Fix proj.h + proj_api.h inclusion errors
2018-02-11Add proj_context_errno to API and missing proj_geod to proj.def (#791)Thomas Knudsen
2018-02-11Make sure that #define's work properly when including proj_api.h and proj.h ↵Kristian Evers
together.
2018-02-10Re-do pull request #451 export CMake targets with PROJ4:: namespaceCharles Karney
This version takes to add the include path to the target definition for cmake 2.8.11 and later. Also the documentation sticks to the existing convention of using cmake variables ${PROJ4_LIBRARIES} and ${PROJ4_INCLUDE_DIRS}. However, the namespace variables are still being included. Here's the roll-out plan (0) Version 4.9.x: The target is proj and PROJ4_LIBRARIES is set to this. (1) Version 5.0.x: Two targets, proj and PROJ4::proj, are defined; PROJ4_LIBRARIES = proj. (2) In a year or two: Two targets, proj and PROJ4::proj, are defined; PROJ4_LIBRARIES = PROJ4::proj. (3) With a change in the library which breaks backwards compatibility: The target is PROJ4::proj and PROJ4_LIBRARIES = PROJ4::proj.
2018-02-10Make the 4D API fully 4D (#788)Thomas Knudsen
Make 4D API fully 4D: Remove PJ_XY, PJ_LP, PJ_XYZ, PJ_LPZ etc. from the API surface and make all formal parameters of the API fully 4D PJ_COORD. This operation primarily influences the proj_XXX_dist functions, which mostly work by calling Charles Karney's geodesic subsystem, keeping the distance, and throwing away the start and end azimuths for the geodesic computed. Also a PJ_GEOD(esic) persona is introduced for the PJ_COORD type. The proj_geod function returns a PJ_GEOD, representing the geodesic between the points represented by its PJ_COORD arguments. Finally, the proj_factors functions had its lp argument changed from PJ_LP to PJ_COORD.
2018-02-10Handle sign convention for vertical datum shiftsThomas Knudsen
Also make corresponding sign corrections in a number of tests, and comment out a few tests which work correctly, but report failure since gie is not yet ready to handle unusual axis orders in cases with angular output coordinates.
2018-02-10Fix numerous bugs in the cs2cs emulationThomas Knudsen
2018-02-10pj_init: set ellipsoid if given, even if not neededThomas Knudsen
2018-02-10gie: repair handling of angular distancesThomas Knudsen
2018-02-10Add BETA2007 grid and change potsdam datum (#383)Even Rouault
Functionnaly equivalent to https://github.com/OSGeo/proj.4/pull/371 by Jürgen Fischer See http://crs.bkg.bund.de/crseu/crs/descrtrans/BeTA/de_dhdn2etrs_beta.php Confirmed with Uwe Schmitz <uwe.schmitz@bezreg-koeln.nrw.de> that free redistribution is allowed and welcome.
2018-02-09Avoid XY, LP and UV datatype clashes with other libraries.Kristian Evers
Remove unnecessary definitions of UV and UVW from project.h that collides with external libraries. To prevent similar problems in the future the datatypes XY, LP, UV, XYZ, LPZ and UVW has been prefixed by PJ_ in proj.h and proj_internal.h
2018-02-07Shrink PJ_XXX_INFO structs, but keep same syntax. (#775)Thomas Knudsen
* Shrink PJ_XXX_INFO structs, but keep same syntax. A number of the fixed length strings in the INFO structs are simply reflections of material that already exists as static strings at a number of places in the library (or in the case of PJ_INFO, really *should* exist, and now is implemented). This PR replaces these cases of constant length strings with const char pointers. The usage syntax is unchanged, and so is the nice property of having the return value allocated on the stack, and hence not requiring explicit memory management by the caller. proj_info now only does setup once - and the searchpath entry of PJ_INFO is not arbitrarily truncated at 512 bytes. Repeated calls simply returns a copy of already prepared material. The id, description and definition entries of PJ_PROJ_INFO are now also guaranteed to hold the entire text of the corresponding static string, by being represented by a const char pointer to that actual static string. PJ_GRID_INFO and PJ_INIT_INFO (i.e. the two smallest INFO structs) are unchanged. * Eliminate pj_strlcpy - not needed anymore: Remining calls could safely be replaced by strncpy. * Extend PROJ_INFO with paths from pj_set_searchpath. NOTE: Need to call pj_set_searchpath before first call to proj_info Huge thanks to Kristian Evers and Even Rouault for comments, debugging and advice.
2018-02-06Use a grid in API selftest that we can always rely on being present.Kristian Evers
2018-02-06Make pj_free return with the correct errno.Kristian Evers
Error codes can't be specified directly in pj_free. With this change the error number in proj_errno() is passed on to P->destructor to ensure that we communicate the correct reason why the PJ object is being freed. This was a problem in the cs2cs_emulation setup when auxillary operations failed to create. The error was not propagated properly when destroying the parent object.
2018-02-06Let gie skip tests when specific errors are returned.Kristian Evers
Introducing a new keyword 'skiperror' that when given a error code like pjd_err_failed_to_load_grid will skip tests if that error is returned when creating the operation. This is useful for grids that can't be located.