diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-11-14 17:40:42 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-11-14 22:48:29 +0100 |
| commit | d928db15d53805d9b728b440079756081961c536 (patch) | |
| tree | e862a961d26bedb34c58e4f28ef0bdeedb5f3225 /src/proj_api.h | |
| parent | 330e8bf686f9c4524075ca1ff50cbca6c9e091da (diff) | |
| download | PROJ-d928db15d53805d9b728b440079756081961c536.tar.gz PROJ-d928db15d53805d9b728b440079756081961c536.zip | |
Implement RFC 2: Initial integration of "GDAL SRS barn" work
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
Diffstat (limited to 'src/proj_api.h')
| -rw-r--r-- | src/proj_api.h | 149 |
1 files changed, 82 insertions, 67 deletions
diff --git a/src/proj_api.h b/src/proj_api.h index 000a0baf..a8a7f106 100644 --- a/src/proj_api.h +++ b/src/proj_api.h @@ -41,6 +41,10 @@ #define PJ_VERSION 600 #endif +#ifdef PROJ_RENAME_SYMBOLS +#include "proj_symbol_rename.h" +#endif + /* If we're not asked for PJ_VERSION only, give them everything */ #ifndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY @@ -53,6 +57,17 @@ #include <stddef.h> #include <stdlib.h> +#ifndef PROJ_DLL +#ifdef PROJ_MSVC_DLL_EXPORT +#define PROJ_DLL __declspec(dllexport) +#elif defined(PROJ_MSVC_DLL_IMPORT) +#define PROJ_DLL __declspec(dllimport) +#elif defined(__GNUC__) +#define PROJ_DLL __attribute__ ((visibility("default"))) +#else +#define PROJ_DLL +#endif +#endif #ifdef __cplusplus extern "C" { @@ -73,8 +88,8 @@ extern "C" { -extern char const pj_release[]; /* global release id string */ -extern int pj_errno; /* global error return code */ +extern char const PROJ_DLL pj_release[]; /* global release id string */ +PROJ_DLL extern int pj_errno; /* global error return code */ #ifndef PROJ_INTERNAL_H /* replaced by enum proj_log_level in proj_internal.h */ @@ -128,87 +143,87 @@ typedef struct projFileAPI_t { /* procedure prototypes */ -projCtx pj_get_default_ctx(void); -projCtx pj_get_ctx( projPJ ); +projCtx PROJ_DLL pj_get_default_ctx(void); +projCtx PROJ_DLL pj_get_ctx( projPJ ); -projXY pj_fwd(projLP, projPJ); -projLP pj_inv(projXY, projPJ); +projXY PROJ_DLL pj_fwd(projLP, projPJ); +projLP PROJ_DLL pj_inv(projXY, projPJ); -projXYZ pj_fwd3d(projLPZ, projPJ); -projLPZ pj_inv3d(projXYZ, projPJ); +projXYZ PROJ_DLL pj_fwd3d(projLPZ, projPJ); +projLPZ PROJ_DLL pj_inv3d(projXYZ, projPJ); -int pj_transform( projPJ src, projPJ dst, long point_count, int point_offset, +int PROJ_DLL pj_transform( projPJ src, projPJ dst, long point_count, int point_offset, double *x, double *y, double *z ); -int pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset, +int PROJ_DLL pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset, double *x, double *y, double *z ); -int pj_geocentric_to_geodetic( double a, double es, +int PROJ_DLL pj_geocentric_to_geodetic( double a, double es, long point_count, int point_offset, double *x, double *y, double *z ); -int pj_geodetic_to_geocentric( double a, double es, +int PROJ_DLL pj_geodetic_to_geocentric( double a, double es, long point_count, int point_offset, double *x, double *y, double *z ); -int pj_compare_datums( projPJ srcdefn, projPJ dstdefn ); -int pj_apply_gridshift( projCtx, const char *, int, +int PROJ_DLL pj_compare_datums( projPJ srcdefn, projPJ dstdefn ); +int PROJ_DLL pj_apply_gridshift( projCtx, const char *, int, long point_count, int point_offset, double *x, double *y, double *z ); -void pj_deallocate_grids(void); -void pj_clear_initcache(void); -int pj_is_latlong(projPJ); -int pj_is_geocent(projPJ); -void pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared); -void pj_pr_list(projPJ); -void pj_free(projPJ); -void pj_set_finder( const char *(*)(const char *) ); -void pj_set_searchpath ( int count, const char **path ); -projPJ pj_init(int, char **); -projPJ pj_init_plus(const char *); -projPJ pj_init_ctx( projCtx, int, char ** ); -projPJ pj_init_plus_ctx( projCtx, const char * ); -char *pj_get_def(projPJ, int); -projPJ pj_latlong_from_proj( projPJ ); -int pj_has_inverse(projPJ); - - -void *pj_malloc(size_t); -void pj_dalloc(void *); -void *pj_calloc (size_t n, size_t size); -void *pj_dealloc (void *ptr); -char *pj_strdup(const char *str); -char *pj_strerrno(int); -int *pj_get_errno_ref(void); -const char *pj_get_release(void); -void pj_acquire_lock(void); -void pj_release_lock(void); -void pj_cleanup_lock(void); - -void pj_set_ctx( projPJ, projCtx ); -projCtx pj_ctx_alloc(void); -void pj_ctx_free( projCtx ); -int pj_ctx_get_errno( projCtx ); -void pj_ctx_set_errno( projCtx, int ); -void pj_ctx_set_debug( projCtx, int ); -void pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) ); -void pj_ctx_set_app_data( projCtx, void * ); -void *pj_ctx_get_app_data( projCtx ); -void pj_ctx_set_fileapi( projCtx, projFileAPI *); -projFileAPI *pj_ctx_get_fileapi( projCtx ); - -void pj_log( projCtx ctx, int level, const char *fmt, ... ); -void pj_stderr_logger( void *, int, const char * ); +void PROJ_DLL pj_deallocate_grids(void); +void PROJ_DLL pj_clear_initcache(void); +int PROJ_DLL pj_is_latlong(projPJ); +int PROJ_DLL pj_is_geocent(projPJ); +void PROJ_DLL pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared); +void PROJ_DLL pj_pr_list(projPJ); +void PROJ_DLL pj_free(projPJ); +void PROJ_DLL pj_set_finder( const char *(*)(const char *) ); +void PROJ_DLL pj_set_searchpath ( int count, const char **path ); +projPJ PROJ_DLL pj_init(int, char **); +projPJ PROJ_DLL pj_init_plus(const char *); +projPJ PROJ_DLL pj_init_ctx( projCtx, int, char ** ); +projPJ PROJ_DLL pj_init_plus_ctx( projCtx, const char * ); +char PROJ_DLL *pj_get_def(projPJ, int); +projPJ PROJ_DLL pj_latlong_from_proj( projPJ ); +int PROJ_DLL pj_has_inverse(projPJ); + + +void PROJ_DLL *pj_malloc(size_t); +void PROJ_DLL pj_dalloc(void *); +void PROJ_DLL *pj_calloc (size_t n, size_t size); +void PROJ_DLL *pj_dealloc (void *ptr); +char PROJ_DLL *pj_strdup(const char *str); +char PROJ_DLL *pj_strerrno(int); +int PROJ_DLL *pj_get_errno_ref(void); +const char PROJ_DLL *pj_get_release(void); +void PROJ_DLL pj_acquire_lock(void); +void PROJ_DLL pj_release_lock(void); +void PROJ_DLL pj_cleanup_lock(void); + +void PROJ_DLL pj_set_ctx( projPJ, projCtx ); +projCtx PROJ_DLL pj_ctx_alloc(void); +void PROJ_DLL pj_ctx_free( projCtx ); +int PROJ_DLL pj_ctx_get_errno( projCtx ); +void PROJ_DLL pj_ctx_set_errno( projCtx, int ); +void PROJ_DLL pj_ctx_set_debug( projCtx, int ); +void PROJ_DLL pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) ); +void PROJ_DLL pj_ctx_set_app_data( projCtx, void * ); +void PROJ_DLL *pj_ctx_get_app_data( projCtx ); +void PROJ_DLL pj_ctx_set_fileapi( projCtx, projFileAPI *); +projFileAPI PROJ_DLL *pj_ctx_get_fileapi( projCtx ); + +void PROJ_DLL pj_log( projCtx ctx, int level, const char *fmt, ... ); +void PROJ_DLL pj_stderr_logger( void *, int, const char * ); /* file api */ -projFileAPI *pj_get_default_fileapi(void); +projFileAPI PROJ_DLL *pj_get_default_fileapi(void); -PAFile pj_ctx_fopen(projCtx ctx, const char *filename, const char *access); -size_t pj_ctx_fread(projCtx ctx, void *buffer, size_t size, size_t nmemb, PAFile file); -int pj_ctx_fseek(projCtx ctx, PAFile file, long offset, int whence); -long pj_ctx_ftell(projCtx ctx, PAFile file); -void pj_ctx_fclose(projCtx ctx, PAFile file); -char *pj_ctx_fgets(projCtx ctx, char *line, int size, PAFile file); +PAFile PROJ_DLL pj_ctx_fopen(projCtx ctx, const char *filename, const char *access); +size_t PROJ_DLL pj_ctx_fread(projCtx ctx, void *buffer, size_t size, size_t nmemb, PAFile file); +int PROJ_DLL pj_ctx_fseek(projCtx ctx, PAFile file, long offset, int whence); +long PROJ_DLL pj_ctx_ftell(projCtx ctx, PAFile file); +void PROJ_DLL pj_ctx_fclose(projCtx ctx, PAFile file); +char PROJ_DLL *pj_ctx_fgets(projCtx ctx, char *line, int size, PAFile file); -PAFile pj_open_lib(projCtx, const char *, const char *); -int pj_find_file(projCtx ctx, const char *short_filename, +PAFile PROJ_DLL pj_open_lib(projCtx, const char *, const char *); +int PROJ_DLL pj_find_file(projCtx ctx, const char *short_filename, char* out_full_filename, size_t out_full_filename_size); #ifdef __cplusplus |
