| Age | Commit message (Collapse) | Author |
|
|
|
In most cases memory deallocation is completely removed from the
code since it can be handled by the default destructor. In a few
special cases a local destructor overrides the default destructor
and makes sure that locally allocated memored is cleaned up correctly.
Move all deallocation from pj_free to pj_default_destructor
Rename pj_latlong.c to fit with the conventional format PJ_latlong.c - freeup was missed here due to wrong naming
Clean up pj_init to avoid double deallocation; Also resolve #576 by adding z_0 and t_0 options in pj_init, while cleaning
Add a prototype for dealloc_params
Added missing errno.h include in pj_ctx.c
Temporarily removing ob_tran from testvarious, to be sure that is where the trouble is
Make PJ_ob_tran.c use proper initialization for the chained projection
proj=ob_tran: make it clear, that we disallow ellipsoidal projections, and, for improved backwards compatibility, turns off default settings, which could inject unwanted ellipsoid definitions
... then also remove the ellipsoid definition from the testvarious test case - which is probably buggy anyway
Work around cs2cs spherical init bug in testvarious; Forbid defs for ob_tran in pj_init
|
|
|
|
|
|
* Adding info functions to proj.h API.
Four new functions are added with this commit: proj_info(), proj_pj_info(),
proj_grid_info() and proj_init_info(). Additionally four new data types are
added: PJ_INFO, PJ_PROJ_INFO, PJ_GRID_INFO and PJ_INIT_INFO. The functions
return the corresponding data types.
These functions allows users of the PROJ.4 library to get information about
various PROJ.4 entities and the library itself. The new data types are structs
that contain specific information about either the library instance, a PJ
instance, a grid or an init file. Together the four new functions cover a big
part of the functionality in the semi-public projects.h API and should hopefully
make it easier for user to migrate their code to the proj.h API in the future.
Besides covering already existing functionality in the old API, this commit
introduces the ability to add metadata to init-files. This is primarily added
to give users a way of knowing which version of the EPSG database they are
using, but it also comes in handy for other init-files. The init-file metadata
is added directly to the init-file as a special "projection" called "metadata".
The info projection of the epsg init-file is thus described as:
<metadata> +version=9.0.0 +origin=EPSG +lastupdate=2017-01-10
The proj_init_info() function uses the internal pj_param() to read the
metadata. As a consequence, "metadata" will not be available as a the name of
a projection in the future. This is a reasonable price to pay considering the
ease of the implementation of adding metadata to init-files this way, and of
course that "metadata" is a very unlikely name for a projection in any case.
A metadata tag has been added to all init-files in the nad-directory. For most
only a subset of the possible parameters has been added.
* Replaced calls to sprintf and strncpy with safer options. Added pj_strlcpy for internal use.
* Fail gracefully when getting non-initialized PJ in proj_pj_info()
* Change length of filename member in PJ_INIT_INFO and PJ_GRID_INFO to 260 (MAX_PATH)
|
|
Eliminated *_ERROR* macros.
|
|
Expanded *_ERROR* macros with calls to proj_errno_set() and proper
returns when necessary. Defined a bunch of new PJD_ERR_ constants in
projects.h that corresponds to the error numbers in pj_strerrno.c. A few
unknown error numbers were replaced by existing ones in pj_strerrno.c.
|
|
C99).
|
|
|
|
* obs_api revision and improvements: new namespace etc.
* Minor corrections: use unused functions, add missing prototype, added fwd/invcoord to PJ
* Minor correction: MSVC barfs on va_arg type specification. Trying once more with added parens
* Reverting paren correction, which appears to be a non-solution
* Significant improvements to the OBS_API, plus a number of corrections, mostly in test code, to reflect API changes
* Added two missing prototypes
* Adding the proj_transform function and some related checks
* Improvements to proj_transform etc. based on suggestions from Even Rouault
* Reducing the libc include footprint of proj.h - again based on suggestions from Even Rouault
* A few minor corrections
* Eliminate a MSVC warning about non-initialized usage. Not an actual issue, as another check has locked the path, but at least this should calm down MSVC
* Improved support for the errno reset/restore paradigm
* Introduced the internal header proj_internal.h; Moved most non-API stuff from pj_obs_api.c to pj_internal.c
* Adding proj_internal.h to HEADERS_LIBPROJ to solve build problems
* Correcting a few pj...proj blunders in PJ_pipeline.c
* Correcting a few additional blunders in PJ_pipeline.c
* Changed angle-brackets to quotation marks in includes of proj_internal.h
* Some minor build system repairs
* Some PJ_CONTEXT usage simplifications following suggestions by Kristian Evers @kbevers
* Added version numbering to proj.h - Fixes #529
* remove proj_errno_restore macro, provide function implementation
* Add proj_get_definition. Fixes #538
* Added library specific deallocator proj_buffer_free, eliminating a potential cross heap issues on Windows. Thx to Even Rouault for spotting this
* Got rid of a meaningless cast in proj_buffer_free
* Added some missing functions to proj.def (again spotted by @rouault); removed some not-yet-implemented material from proj.h
* Renamed proj_get_definition/proj_buffer_free to proj_definition_create/proj_definition_destroy, for symmetry and clarity
* Renaming the definition handlers to proj_definition_retrieve / proj_free
* Renaming proj_free to proj_release
|
|
|
|
Negative values of m and n are not valid. Can for certain values of m
and n result in zero division. An error is raised at projection setup if
m or n is negative.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1836
Credit to OSS-Fuzz.
|
|
Avoids zero-division in PJ_helmert.c
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1956
Credit to OSS-Fuzz.
|
|
A pseudo-projection that can be used to convert units of input and
output data. Primarily useful in pipelines.
Unit conversion is performed by means of a pivot unit. The pivot unit
for distance units are the meter and for time we use the modified julian
date. A time unit conversion is performed like
Unit A -> Modified Julian date -> Unit B
distance units are converted in the same manner, with meter being the
central unit.
The modified Julian date is chosen as the pivout unit since it has a
fairly high precision, goes sufficiently long backwards in time, has no
danger of hitting the upper limit in the near future and it is a fairly
common time unit in astronomy and geodesy. Note that we are using the
Julian date and not day. The difference being that the latter is defined
as an integer and is thus limited to days in resolution. This approach
has been extended wherever it makes sense, e.g. the GPS week unit also
has a fractional part that makes it possible to determine the day, hour
and minute of an observation.
In- and output units are controlled with the parameters
+xy_in, +xy_out, +z_in, +z_out, +t_in and +t_out
where xy denotes horizontal units, z vertical units and t time units.
Distance units are converted similar to what is already in use in PROJ.4.
To ease usage of the already defined conversion factors a new column
with the factors defined as doubles has been added to the pj_units array.
This simplifies the code significantly, since parsing the defined strings
can be avoided.
|
|
C11 compilation
|
|
-Wmissing-prototypes -Wmissing-declarations
|
|
|
|
|
|
|
|
* re-enter pipeline
The pipeline interface is now internally based on the pj_obs_api, which
simplifies the implementation significantly.
This is the first mock up - it compiles fine, but is currently untested
* pipeline code cleaned up
The pipeline code is now based on the PJ_OBS api (although you can still
invoke a pipeline through pj_fwd/pj_inv and their 3D brethren).
This has made it possible to eliminate scores of funky casts and
convoluted workarounds. The code is now way more straightforward and
mostly conforming with common C idioms..
Also, the proj.h / obs_api interface to the logging system has been
streamlined through the introduction of the pj_log_error, pj_log_debug,
and pj_log_trace functions.
* Geodesics + minor changes
First proj.h style interface to Charles Karney's geodesics code:
pj_lp_dist.
Also, renamed pj_apply -> pj_trans
* Extended Ellipsoidal Parameters
Second eccentricity, second and third flattening etc.
* Rename pj_debug_set -> pj_log_level
... and add self test code for PJ_pipeline
* Clean up missing pj_apply->pj_trans
* Clean up missing pj_obs_dist_2d rename
* pj_strerrno bug fixed. Some doc/comments added
(In response to a review by @kbevers)
|
|
(#445)
This commit reflects continued work on the new rationalized API with
geodetic extensions (see rationale in proj.h). It also reflects the
parallel work on the transformation pipeline reimplementation, by
introducing the PJ_cart cartesian/ellipsoidal converter.
See example/pj_obs_api_test.c for demo example code
|
|
* Pipeline preliminaries
Introducing the PJ_OBSERVATION data type as the basis for generic geodetic
transformations.
Also introducing the elements of a new minimalistic API focused on
generic geodetic transformations. This API is documented in the new
proj.h header, and is orthogonal (non-intrusive) wrt. the existing API
from proj_api.h
Finally added a large amount of comments to the somewhat intractable
projects.h, and extended the PJ object with a number of additional
ellipsoidal parameters of general geodetic usefulness.
The PJ elements fwdobs and invobs extend fwd3d and inv3d in a homologous
way to how fwd3d and inv3d extend fwd and inv.
|
|
|
|
|
|
last digit changed to 9
|
|
facto standard M_PI and its ilk. Change names that are widely used in the project to be in the M_ namespace, so HALFPI becomes M_HALFPI. HALFPI is #defined as M_PI_2 (the defacto standard name). #defines _USE_MATH_DEFINES for MS Visual Studio (I didn't personally test this part, but Appveyor will not build otherwise).
|
|
calcofi, cass,cc,wag2, wag3, wag7, wink1, wink2
|
|
The projection list maintained by code in pj_list.c depended on stuff in
projects.h.
This stuff is non-obvious and since it is only used in pj_list.c, it has
been moved from projects.h to pj_list.c (The material moved is based on
some really clever X-macro techniques implemented by numerous
redefinitions of the PROJ_HEAD macro, followed by immediate re-inclusion
of te pj_list.h file).
Also, the self test runner pj_run_selftests has been remodelled, now
depending on a list of self test functions, generated in a similar way
to the projection list, and like the projection list generated by
X-macro techniques in pj_list.c.
For this to work, self test functions need to be available for all
projections. To fulfill this, stubs for all projections not having self
tests already, have been added to PJ_aea.c
Along with the recent build system patches by @kbevers, this first part
of the macro-refactoring project is considered close to finished.
|
|
Need these to reduce the chance I'm screwing up something during this
rather intrusive code surgery
|
|
The brief version::
In an attempt to make proj.4 code slightly more secure and much easier
to read and maintain, I'm trying to eliminate a few unfortunate design
decisions from the early days of proj.4
The work will be *very* intrusive, especially in the PJ_xxx segment of
the code tree, but great care has been taken to design a process that
can be implemented stepwise and localized, one projection at a time,
then finalized with a relatively small and concentrated work package.
The (very) long version: See the comments in PJ_minimal.c
|
|
|
|
Conflicts:
nad/tv_out.dist
|
|
Add a test to check this. Output of an existing test changed in 7th
decimal place.
|
|
- New SCH coordinate system for radar imaging systems
|
|
|
|
Remove setlocale() use in pj_init_ctx(), and replace uses of atof() &
strtod() by their locale safe variants pj_atof() and pj_strtod().
Proj versions from now advertize #define PJ_LOCALE_SAFE 1 in proj_api.h
and export pj_atof() & pj_strtod()
|
|
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2356 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2355 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2347 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2345 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2344 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2219 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2218 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2196 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2121 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2048 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2045 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2000 4e78687f-474d-0410-85f9-8d5e500ac6b2
|
|
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1999 4e78687f-474d-0410-85f9-8d5e500ac6b2
|