| Age | Commit message (Collapse) | Author |
|
|
|
structures
|
|
C++ file due to C++ objects in struct PJconsts
|
|
|
|
|
|
|
|
|
|
|
|
the data/epsg and data/IGNF files
|
|
of use argument, and make createFromUserInput() recognize init=epsg: / init=IGNF: in legacy mode, that is when proj_context_get_use_proj4_init_rules() is used
|
|
This work mostly consists of:
- a C++ implementation of the ISO-19111:2018 / OGC Topic 2
"Referencing by coordinates" classes to represent Datums,
Coordinate systems, CRSs (Coordinate Reference Systems) and
Coordinate Operations.
- methods to convert between this C++ modeling and WKT1, WKT2
and PROJ string representations of those objects
- management and query of a SQLite3 database of CRS and Coordinate Operation definition
- a C API binding part of those capabilities
This is all-in-one squashed commit of the work of
https://github.com/OSGeo/proj.4/pull/1040
|
|
|
|
With projects.h not being available to outside users anymore we need to
define PJ_UNITS, PJ_ELLPS, PJ_PRIME_MERIDIANS and PJ_OPERATIONS
elsewhere.
Related pj_get_*_ref() functions have been removed in favour
of their proj_ namespaced counterparts.
char pointers have been changed to const char pointers.
Resolves #983
Resolved #1147
Make char pointers const
|
|
pj_mkparam() and pj_mkparam_ws() doesn't alter the input string
should therefore be const. This will be useful when making other
changes to the code base later.
|
|
Closes #853
|
|
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
|
|
optimization issue with gcc 8.2 (fixes #1084)
|
|
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]
|
|
that it supports numeric factors (refs #1053)
|
|
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
|
|
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.
|
|
Original mispelled constant kept for backward compatibility.
|
|
|
|
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
|
|
* 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.
|
|
Closes #582
|
|
|
|
|
|
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>
|
|
|
|
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
|
|
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
|
|
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.
|
|
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)
|
|
|
|
* Replace pj_ell_set with reimplementation supporting ellipsoid inheritance
* remove unreachable code from pj_ell_set.c
* Swap steps, so ellps args are read first, in accordance with historical behaviour
* Add ellipsoid tests to CI targets
* Reduce some optimistic tolerances
OS/X appears to have a slightly off float handling, resulting in differences at the nanometer level. Switching to 10 nm.
|
|
* Support numerical factors only
* Make sure h positive. Improve some comments
* Let pole overshoot check have effect even for geocentric latitudes
* Factor-typological constants, now all returning false, for backwards compatibility
|
|
* Removed remaining traces of the builtin selftest system. Moved all functionality to test/gie
* Updated Appveyor and Travis build scripts
* Another appveyor script update
|
|
Use HAVE_C99_MATH instead of _WIN32_ and __ANSI__
|
|
HAVE_C99_MATH was recently added to the build system as a safer way to
determine if non-ansi math functions are available on the current
system. Previously different combinations of tests including _WIN32_ and
__ANSI__ have been in use, but cases where that strategy has failed is
known. Hence this change to a hopefully more robust check of math
function availability.
|
|
|
|
PJ_OBS eliminated, API adjusted to reflect that we now have only one 4D data type.
2 new API functions added to determine output types of a PJ.
|
|
* Discern between conversions and transformations
|
|
* Remove a number of debugging calls and memory management from the inner loop of the pipeline drivers
* An attempt at handling inverted steps in a more straightforward way
|
|
Allow nested pipelines when wrapped in +init's.
The previous behaviour was to quit pipeline initialization when
encountering a nested pipeline definition. With this commit that
behaviour is changed so that it is possible to nest pipelines as
long as they are defined elsewhere in a init-file.
This is useful in init-files where steps in complicated transformations
can be grouped in "sub-pipelines". These "sub-pipelines" can then be
used as individual steps in a larger and more complicated pipeline.
Nested pipelines are governed by the following rules:
1. You can't have more than one literal +proj=pipeline in a proj-string
2. Pipelines can be nested if they are wrapped up in a +init
3. More than one +init is disallowed in non-pipeline proj-strings
4. +inits are expanded as late as possible, that is they will only be
expanded in single operations (that can be a part of a pipeline)
|
|
* Linguistics: Clarify this and that, here and there
* Revert nullification of PJ_cart->fwd, inv
|
|
* Remove PJ_OBS from the API surface, rename pj_obs_api.c to pj_4D_api.c
* Repair proj.def
|
|
In anticipation of a late-binding implementation of the proj_transform_crs_to_crs function
an area argument is added to the function prototype. The PJ_AREA struct is not in use yet,
but will be when the function is more tightly coupled to the EPSG database in the future.
|
|
* Prevent crashes and leaks on allocation failure
Memory allocation can fail. We need to gracefully handle this case and
prevent dereferencing null pointers.
* Make NULL checks consistent within a file
* Properly report allocation errors
* Improve cleanup in pj_gc_reader.c
* Implement pj_strdup and use instead of strdup
The function strdup is not part of ANSI C 89, but a POSIX extension.
Therefore we can not rely on it being available on all platforms.
|