| Age | Commit message (Collapse) | Author |
|
DHDN_ETRS89 autoconf test
|
|
The previous commits were added way to prematurely. The code was not
properly tested and it turned out to do more bad than good. This commit
hopefully fixes that. And this time it is backed up by tests!
DMS style coordinates should now be fully functional in gie. Finger
crossed.
|
|
|
|
proj_strtod doesn't read values like 123d45'678W so we need a bit
of help from proj_dmstor. proj_strtod effectively ignores what
comes after "d", so we use that fact that when dms is larger than
d the value was stated in "dms" form.
This could be avoided if proj_dmstor used the same proj_strtod()
as gie, but that is not the case (yet). When we remove projects.h
from the public API we can change that.
|
|
Observed a buffer overflow in append_args with autofuzz with the strcpy in append_args.
I think the +2 is required to account for both a nul char and the space.
|
|
Ensure that operations are less than MAX_OPERATION long.
|
|
Add test framework, C++11 compilation mode and warning fixes
|
|
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
|
|
Buffer overflow found with autofuzz.
|
|
- printf -> fprintf in more places
- puts -> fprintf
- Move list_err_codes to after where T.fout is set
This makes fuzzing easier by allowing more of the output to be sent to
/dev/null. Found with autofuzz.
|
|
Return NaN coordinate immediately when receiving NaN input
|
|
Use proj_strtod.h for proj_strtod and proj_atof
|
|
|
|
|
|
Why was fabs applied to ntrips? And why is it parsed as a float?
Also add documentation for roundtrip.
External rst docs do not match this function.
|
|
|
|
input. Added test to check for those cases.
|
|
|
|
Function prototypes were declared twice for the FFIO framework, probably
because FFIO at some point during development existed as a separate
file. With this commit the second set of function prototypes is removed
leaving only the first entry at the top of the file. Similarly duplicate
header inclusions has been removed.
|
|
|
|
Collect custom C99 math functions in proj_math.h
|
|
We are relying more and more on C99 math functions. On C89 systems where
those functions are not available our own custom versions of those
functions are used instead. So far these has been spread across the code
base. This commit gathers them in the same file and introduces the
proj_math.h header. The build system checks for C99 math functions. If
not found the proj_math.h header make sure that C99 functions are
defined as their pj_ equivalent.
Ideally proj_math.h is included instead of math.h. This removes the need
for any checks against HAVE_C99_MATH in the code making it easier to
read.
For this commit the functions hypot, log1p and asinh has been taken care
of.
|
|
|
|
Print help
|
|
Previously gie would return "Nothing to do" when called without
arguments. With this change the help text is returned instead.
|
|
|
|
|
|
Leaving x, y, z fields unset triggers an MSAN failure.
fwd_prepare pj_fwd.c:40:9
pj_fwd4d pj_fwd.c:260:15
proj_trans proj_4D_api.c:166:20
test_time gie.c:1955:11
|
|
|
|
Remove 'pj_' prefix from static functions
|
|
|
|
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.
|
|
* 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
|
|
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.
|
|
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)
|
|
|
|
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.
|
|
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.
|
|
|
|
* 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.
|
|
|
|
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.
|
|
Additionally correct a spelling error in optargpm.h and
remove two lines of leftover cruft from gie.c
|
|
Parameters such as towgs84, nadgrids and geoidgrids was previously only
handled by pj_transform(). This commit add a compatibility layer in
proj_create() by calling the pj_cs2cs_emulation_setup() function. This
function sets up a handful of predefined transformation objects on the
PJ object that is being created. Each of these transformation objects
are related to the cs2cs-style parameters we are trying to emulate in
the 4D API. That is, if the +towgs84 parameters is used we create
P->helmert with the parameters specified in +towgs84. Similarly for
+axis, +nadgrids and +geoidgrids. When these transformation objects
exists we use them in the prepare and finalize functions in pj_fwd/
pj_inv. If no cs2cs-style parametes are specified we skip those
parts of the prepare and finalizing steps.
Co-authored-by:Thomas Knudsen <thokn@sdfe.dk>
Co-authored-by:Kristian Evers <kristianevers@gmail.com>
|
|
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.
|
|
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
|
|
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
|
|
* Some corrections in response to a review by Kristian Evers
|
|
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.
|
|
* 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
|