aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-09-21coding style (https://travis-ci.com/OSGeo/proj.4/jobs/147225960 & ↵Philippe Rivière
https://travis-ci.com/OSGeo/proj.4/jobs/147274068)
2018-09-21the Bertin 1953 projectionPhilippe Rivière
2018-09-21Remove misspelled-constant PJD_ERR_UNKNOW_UNIT_IDKristian Evers
Closes #853
2018-09-21Replace calls to pj_factors with proj_factorsKristian Evers
2018-09-21Replace calls to rtodms/dmstor with proj.h equivalentsKristian Evers
2018-09-19Merge pull request #1125 from rouault/rename_nad_as_dataKristian Evers
Rename nad/ as data/ and move nad/test* to test/old/*
2018-09-18Rename nad/ directory as data/Even Rouault
2018-09-18Only allow usage of proj_api.h if explicit consent was givenKristian Evers
We want to flag that proj_api_h is now deprecated. With this commit it is now mandatory to #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H before proj_api.h can be included. proj_api.h is used internally a bunch of places. Therefore ACCEPT_USE_OF_DEPRECATED_PROJ_API_H has been defined in projects.h and a few other necessary files to ensure that PROJ compiles. Closes #836
2018-09-18Do not install projects.hKristian Evers
In version 6 we stop exposing the deprecated projects.h API to the world outside PROJ. Closes #835
2018-09-15Bump version numbers after 5.2.0 releaseKristian Evers
2018-09-11Update release dateKristian Evers
2018-09-11Fix SONAME decrement from libproj.so.13 to libproj.so.12.Bas Couwenberg
Increment age instead of revision for added interfaces, see: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
2018-09-10Update ABI version for 5.2 releaseKristian Evers
2018-09-07cs2cs: Always convert to degrees when angular output is received (#1112)Kristian Evers
Previous to this commit cs2cs did not convert angular output to degrees when using operations setting PJ->right = PJ_IO_UNITS_ANGULAR. This commit adopts the conventions used after the introduction of pipelines. In practice, this allows the following and similar transformations to output in degrees and not radians: ``` echo 37.3916666667 -6.9325000 | cs2cs +proj=latlong +ellps=clrk80 \ +to +proj=molodensky +ellps=clrk80 +da=-112.145 +df=-0.54750714e-4 \ +dx=-175 +dy=-23 +dz=-303 37.39 -6.93 -8.2 ```
2018-09-07cct: forward comments to outputKristian Evers
Any text written after the coordinate input will automatically be forwarded to the output stream. Text in columns before the coordinate input is discarded in the output. This works for any combination of -c, -t and -z parameters: $ echo 12 56 100 2018.0 comment comment | cct +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment commen $ echo text 12 56 100 2018.0 comment | cct -c 2,3,4,5 +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment $ echo text 12 56 comment | cct -c 2,3 -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment $ echo 12 56 comment | cct -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment Closes #918
2018-09-05Add -d option to proj, cs2cs and cct (#1109)Søren Holm
Specify number of decimals to display when transforming coordinates with either proj, cs2cs or cct.
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-24proj_4D_api.c: fix potential null pointer dereference. Fixes ↵Even Rouault
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10033. Credit to OSS Fuzz. master only
2018-08-24Improve numerical precision of inverse spherical mercatorKristian Evers
Complements f2b3604
2018-08-24Merge pull request #1093 from rouault/geoc_flag_fixKristian Evers
Assorted fixes related to +geoc flag handing
2018-08-23Merge pull request #1096 from rouault/fix_helmert_convention_confusionEven Rouault
[BREAKING] Helmert: add +convention=position_vector/coordinate_frame, forbids +transpose (fixes #1091)
2018-08-22Style and comment improvements to eqearth (#1102)Bojan Šavrič
2018-08-22Adding ellipsoidal equations for the Equal Earth (#1101)Bojan Šavrič
2018-08-21[BREAKING] Hermert: add +convention=position_vector/coordinate_frame, ↵Even Rouault
forbids +transpose (fixes #1091) As identified in #1091, Helmert implementation in PROJ 5.0 and 5.1 is confusing. It happens that by default it used the coordinate_frame convention, contrary to the position_vector convention used traditionaly for +towgs84. The documentation of Helmert was also wrongly specifying that the default convention was position_vector. This commit: - bans the confusing +transpose parameter - removes the concept of a default convention, since in practice both are equally found, and requires +convention as soon as a rotational term parameter is present. For translation only, convention is ignored and optional, as having no effect. - fixes all the identified uses of proj=helmert in code, doc and tests This is obviously a breaking change: - users will have to adapt their pipeline expressions - in particular, init files that would use helmert must be adapted However, as designed, the break will be explicit, and not silent.
2018-08-20Fixes for webmerc projection (fixes #1078)Even Rouault
This is intended to supersed https://github.com/OSGeo/proj.4/pull/1080 with a number of differences. What is kept from #1080 is not forcing the ellipsoid_params to be the one of a sphere. This is not required for correct coordinate computation and avoid lying on the various distorsion parameters. For better interoperability with EPSG, we also no longer force the lam0 parameter to 0, because https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1024 has a provision for it, even if in practice they will always be zero phi0 should always be zero and is not used by the formulas. Another difference with the #1080 approach is that we do not force the WGS84 ellipsoid. Perhaps someone will use webmerc for another planet, even if that is a crazy idea...
2018-08-19pj_transform / cs2cs: honour +geoc flagEven Rouault
2018-08-19Remove dead code in fwd_finalize() and inv_prepare()Even Rouault
Those functions contain code specific of input != angular and output = angular which to the best of my knowledge never happens in PROJ. Looking at that code, I feel there are a number of errors in it, and anyway removing it shows absolutely no change in the test suite, which shows it is unused. I've also added exit(1) to verify that those code paths are never taken. This was found while investigating the fix for 8cfc81380617ff4a17a06a97635f77c5e9ed7d5b
2018-08-19pj_inv(): fix inverse of +proj=longlat +geocEven Rouault
There is a regression in PROJ 5 regarding the handling of the +geoc flag, specific to the case of +proj=longlat, and the inverse transformation, which makes it a no-op: echo "12 55 0 " | src/cct +proj=pipeline +step +proj=longlat +ellps=GRS80 +geoc +inv 12.0000000000 55.0000000000 0.0000 inf With this fix, we now get: echo "12 55 0 " | src/cct +proj=pipeline +step +proj=longlat +ellps=GRS80 +geoc +inv 12.0000000000 54.8189733083 0.0000 inf The fix consists in making inv_prepare() do symetrically as fwd_finalize(), ie skip a number of transforms when left and right units are angular, and in inv_finalize() apply the (OUTPUT_UNITS==PJ_IO_UNITS_ANGULAR) processing even if INPUT_UNITS == PJ_IO_UNITS_ANGULAR
2018-08-17Implementation of Equal Earth projection (#1090)jdugge
Implement the Equal Earth projection (closes #1085)
2018-08-11gie: add a require_grid keyword, and use if for DHDN_ETRS89.gie; aso fix ↵Even Rouault
DHDN_ETRS89 autoconf test
2018-08-11projects.h: use param[] variable-length member syntax with GCC >= 8 to fix ↵Even Rouault
optimization issue with gcc 8.2 (fixes #1084)
2018-08-11Fix wrong behaviour of torad_coord() with gcc 8.1 -O2 (fixes #1084)Even Rouault
torad_coord() of gie.c has this sequence: ``` if( cond ) axis = l->param + strlen ("axis="); n = strlen (axis); ``` When the if branch is evaluated, n is always zero even if on inspection axis is non empty The reason is that the struct ARG_list which is the type of l use a variable-length array for the param member struct ARG_list { paralist *next; char used; char param[1]; }; But this is not a proper way of declaring it, and gcc 8 has apparently optimizations to detect that l->param + 5 points out of the array, hence it optimizes strlen() to 0. Reported as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 According to https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html, the proper way of declaring such arrays is to use [0]
2018-07-26pj_strerrno(): Change check off err value to avoid undefined behavior.Kurt Schwehr
src/pj_strerrno.c:96:20: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself #0 in pj_strerrno proj/src/pj_strerrno.c:96:20 #1 in (anonymous namespace)::ProjErrnoStringTest_ProjErrnos_Test::TestBody() test/unit/proj_errno_string_test.cpp:47:5 ASAN UndefinedBehaviorSanitizer: signed-integer-overflow Issue revealed by proj_errno_string_test.cpp add in https://github.com/OSGeo/proj.4/commit/b87b59106879188ffc684a41a9de638ac5fd02bf
2018-07-21Remove unused '+no_rot' parameterKristian Evers
2018-07-21Check for use of both +k and +k_0 in krovakKristian Evers
2018-07-20Use error code constant instead of numberKristian Evers
2018-07-12Merge pull request #1075 from cffk/geod-unit-fixCharles Karney
Fix #1074. Fix unit conversion factors for geod.
2018-07-11Revert pj_units to_meters entries for US units.Charles Karney
Bletch, pj_init also decodes the to_meters field of pj_unit, but only handles plain numbers or 1/nnn, but not 1./nnn or mmm/nnn. (So the original code would have not decoded the us-in entry properly.) Probably pj_init should be changed to use the factor field instead. Alternatively pj_init should look for a "/" anywhere in the field and decode the numerator and denominator as separate doubles. This would be needed if ratios are ever to be entered directly by the user (this is the strategy used by GeographicLib). And then, of course, the functionality should be provided by a separate utility function.
2018-07-11Remove ugly assignment within an expression.Charles Karney
2018-07-11Fix #1074. Fix unit conversion factors for geod.Charles Karney
Previously, unit conversion using atof(unit_list[i].to_meter) which gives the wrong answer with, e.g., "1/10". Now it directly uses unit_list[i].factor (e.g., 0.1). Also fix all the conversion factors for the US Surveyor units so that they are the closest doubles. E.g., the conversion factors for US feet are factor rel error old 0.304800609601219 6e-16 12/39.37 1e-16 now 1200/3937.0 5e-17 Maybe someone should check the Indian units (but it's possible that India and Pakistan have different standards).
2018-07-10vgridshift: add a +multiplier={value} parameterEven Rouault
As mentionned in #1071, it is often unclear how the offset of a vertical grid is applied.
2018-07-07Merge pull request #1065 from rouault/helmert_with_t_huge_valEven Rouault
Helmert: consider that xyzt.t == HUGE_VAL means t_epoch
2018-07-06Use M_PI_2 and M_PI_4 instead of locally defined constantsKristian Evers
2018-06-29Helmert: consider that xyzt.t == HUGE_VAL means t_epochEven Rouault
Currently when doing echo "2 49 0" | src/cct +proj=pipeline +ellps=GRS80 +step +proj=cart +step +proj=helmert +x=10 +y=3 +z=1 we get as a result: -nan -nan -nan inf This is due to cct initializing the xyzt.t to HUGE_VAL
2018-06-26Add inverse lagrange projectionKristian Evers
Courtesy of Michael Stumpf <mi12st34@gmail.com>
2018-06-22Merge pull request #1055 from rouault/geocent_cart_to_meterKristian Evers
Make +proj=geocent and +proj=cart take into account +to_meter (relates to #1053)
2018-06-21Make +proj=geocent and +proj=cart take into account +to_meter (relates to #1053)Even Rouault
2018-06-21unitconvert: error out if xy_in/xy_out z_in/z_out use different unit typesEven 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-20Add proj_errno_string() to proj.defKristian Evers