gooderp18绿色标准版
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

228 lines
8.2KB

  1. /******************************************************************************
  2. * Project: PROJ.4
  3. * Purpose: Public (application) include file for PROJ.4 API, and constants.
  4. * Author: Frank Warmerdam, <warmerdam@pobox.com>
  5. *
  6. ******************************************************************************
  7. * Copyright (c) 2001, Frank Warmerdam <warmerdam@pobox.com>
  8. *
  9. * Permission is hereby granted, free of charge, to any person obtaining a
  10. * copy of this software and associated documentation files (the "Software"),
  11. * to deal in the Software without restriction, including without limitation
  12. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  13. * and/or sell copies of the Software, and to permit persons to whom the
  14. * Software is furnished to do so, subject to the following conditions:
  15. *
  16. * The above copyright notice and this permission notice shall be included
  17. * in all copies or substantial portions of the Software.
  18. *
  19. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  20. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  22. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  24. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  25. * DEALINGS IN THE SOFTWARE.
  26. *****************************************************************************/
  27. /*
  28. * This version number should be updated with every release!
  29. *
  30. * This file is expected to be removed from the PROJ distribution
  31. * when a few minor-version releases has been made.
  32. *
  33. */
  34. #ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
  35. #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
  36. #endif
  37. #ifndef PJ_VERSION
  38. #define PJ_VERSION 620
  39. #endif
  40. #ifdef PROJ_RENAME_SYMBOLS
  41. #include "proj_symbol_rename.h"
  42. #endif
  43. /* If we're not asked for PJ_VERSION only, give them everything */
  44. #ifndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY
  45. /* General projections header file */
  46. #ifndef PROJ_API_H
  47. #define PROJ_API_H
  48. /* standard inclusions */
  49. #include <math.h>
  50. #include <stddef.h>
  51. #include <stdlib.h>
  52. #ifndef PROJ_DLL
  53. #ifdef PROJ_MSVC_DLL_EXPORT
  54. #define PROJ_DLL __declspec(dllexport)
  55. #elif defined(PROJ_MSVC_DLL_IMPORT)
  56. #define PROJ_DLL __declspec(dllimport)
  57. #elif defined(__GNUC__)
  58. #define PROJ_DLL __attribute__ ((visibility("default")))
  59. #else
  60. #define PROJ_DLL
  61. #endif
  62. #endif
  63. #ifdef __cplusplus
  64. extern "C" {
  65. #endif
  66. /* pj_init() and similar functions can be used with a non-C locale */
  67. /* Can be detected too at runtime if the symbol pj_atof exists */
  68. #define PJ_LOCALE_SAFE 1
  69. #define RAD_TO_DEG 57.295779513082321
  70. #define DEG_TO_RAD .017453292519943296
  71. #if defined(PROJ_H)
  72. #define PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API
  73. #endif
  74. extern char const PROJ_DLL pj_release[]; /* global release id string */
  75. PROJ_DLL extern int pj_errno; /* global error return code */
  76. #ifndef PROJ_INTERNAL_H
  77. /* replaced by enum proj_log_level in proj_internal.h */
  78. #define PJ_LOG_NONE 0
  79. #define PJ_LOG_ERROR 1
  80. #define PJ_LOG_DEBUG_MAJOR 2
  81. #define PJ_LOG_DEBUG_MINOR 3
  82. #endif
  83. #ifdef PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API
  84. /* These make the function declarations below conform with classic proj */
  85. typedef PJ *projPJ; /* projPJ is a pointer to PJ */
  86. typedef struct projCtx_t *projCtx; /* projCtx is a pointer to projCtx_t */
  87. # define projXY PJ_XY
  88. # define projLP PJ_LP
  89. # define projXYZ PJ_XYZ
  90. # define projLPZ PJ_LPZ
  91. #else
  92. /* i.e. proj_api invoked as primary API */
  93. typedef struct { double u, v; } projUV;
  94. typedef struct { double u, v, w; } projUVW;
  95. typedef void *projPJ;
  96. #define projXY projUV
  97. #define projLP projUV
  98. #define projXYZ projUVW
  99. #define projLPZ projUVW
  100. typedef void *projCtx;
  101. #endif
  102. /* If included *after* proj.h finishes, we have alternative names */
  103. /* file reading api, like stdio */
  104. typedef int *PAFile;
  105. typedef struct projFileAPI_t {
  106. PAFile (*FOpen)(projCtx ctx, const char *filename, const char *access);
  107. size_t (*FRead)(void *buffer, size_t size, size_t nmemb, PAFile file);
  108. int (*FSeek)(PAFile file, long offset, int whence);
  109. long (*FTell)(PAFile file);
  110. void (*FClose)(PAFile);
  111. } projFileAPI;
  112. /* procedure prototypes */
  113. projCtx PROJ_DLL pj_get_default_ctx(void);
  114. projCtx PROJ_DLL pj_get_ctx( projPJ );
  115. projXY PROJ_DLL pj_fwd(projLP, projPJ);
  116. projLP PROJ_DLL pj_inv(projXY, projPJ);
  117. projXYZ PROJ_DLL pj_fwd3d(projLPZ, projPJ);
  118. projLPZ PROJ_DLL pj_inv3d(projXYZ, projPJ);
  119. int PROJ_DLL pj_transform( projPJ src, projPJ dst, long point_count, int point_offset,
  120. double *x, double *y, double *z );
  121. int PROJ_DLL pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset,
  122. double *x, double *y, double *z );
  123. int PROJ_DLL pj_geocentric_to_geodetic( double a, double es,
  124. long point_count, int point_offset,
  125. double *x, double *y, double *z );
  126. int PROJ_DLL pj_geodetic_to_geocentric( double a, double es,
  127. long point_count, int point_offset,
  128. double *x, double *y, double *z );
  129. int PROJ_DLL pj_compare_datums( projPJ srcdefn, projPJ dstdefn );
  130. int PROJ_DLL pj_apply_gridshift( projCtx, const char *, int,
  131. long point_count, int point_offset,
  132. double *x, double *y, double *z );
  133. void PROJ_DLL pj_deallocate_grids(void);
  134. void PROJ_DLL pj_clear_initcache(void);
  135. int PROJ_DLL pj_is_latlong(projPJ);
  136. int PROJ_DLL pj_is_geocent(projPJ);
  137. void PROJ_DLL pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared);
  138. void PROJ_DLL pj_pr_list(projPJ);
  139. void PROJ_DLL pj_free(projPJ);
  140. void PROJ_DLL pj_set_finder( const char *(*)(const char *) );
  141. void PROJ_DLL pj_set_searchpath ( int count, const char **path );
  142. projPJ PROJ_DLL pj_init(int, char **);
  143. projPJ PROJ_DLL pj_init_plus(const char *);
  144. projPJ PROJ_DLL pj_init_ctx( projCtx, int, char ** );
  145. projPJ PROJ_DLL pj_init_plus_ctx( projCtx, const char * );
  146. char PROJ_DLL *pj_get_def(projPJ, int);
  147. projPJ PROJ_DLL pj_latlong_from_proj( projPJ );
  148. int PROJ_DLL pj_has_inverse(projPJ);
  149. void PROJ_DLL *pj_malloc(size_t);
  150. void PROJ_DLL pj_dalloc(void *);
  151. void PROJ_DLL *pj_calloc (size_t n, size_t size);
  152. void PROJ_DLL *pj_dealloc (void *ptr);
  153. char PROJ_DLL *pj_strdup(const char *str);
  154. char PROJ_DLL *pj_strerrno(int);
  155. int PROJ_DLL *pj_get_errno_ref(void);
  156. const char PROJ_DLL *pj_get_release(void);
  157. void PROJ_DLL pj_acquire_lock(void);
  158. void PROJ_DLL pj_release_lock(void);
  159. void PROJ_DLL pj_cleanup_lock(void);
  160. void PROJ_DLL pj_set_ctx( projPJ, projCtx );
  161. projCtx PROJ_DLL pj_ctx_alloc(void);
  162. void PROJ_DLL pj_ctx_free( projCtx );
  163. int PROJ_DLL pj_ctx_get_errno( projCtx );
  164. void PROJ_DLL pj_ctx_set_errno( projCtx, int );
  165. void PROJ_DLL pj_ctx_set_debug( projCtx, int );
  166. void PROJ_DLL pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) );
  167. void PROJ_DLL pj_ctx_set_app_data( projCtx, void * );
  168. void PROJ_DLL *pj_ctx_get_app_data( projCtx );
  169. void PROJ_DLL pj_ctx_set_fileapi( projCtx, projFileAPI *);
  170. projFileAPI PROJ_DLL *pj_ctx_get_fileapi( projCtx );
  171. void PROJ_DLL pj_log( projCtx ctx, int level, const char *fmt, ... );
  172. void PROJ_DLL pj_stderr_logger( void *, int, const char * );
  173. /* file api */
  174. projFileAPI PROJ_DLL *pj_get_default_fileapi(void);
  175. PAFile PROJ_DLL pj_ctx_fopen(projCtx ctx, const char *filename, const char *access);
  176. size_t PROJ_DLL pj_ctx_fread(projCtx ctx, void *buffer, size_t size, size_t nmemb, PAFile file);
  177. int PROJ_DLL pj_ctx_fseek(projCtx ctx, PAFile file, long offset, int whence);
  178. long PROJ_DLL pj_ctx_ftell(projCtx ctx, PAFile file);
  179. void PROJ_DLL pj_ctx_fclose(projCtx ctx, PAFile file);
  180. char PROJ_DLL *pj_ctx_fgets(projCtx ctx, char *line, int size, PAFile file);
  181. PAFile PROJ_DLL pj_open_lib(projCtx, const char *, const char *);
  182. int PROJ_DLL pj_find_file(projCtx ctx, const char *short_filename,
  183. char* out_full_filename, size_t out_full_filename_size);
  184. #ifdef __cplusplus
  185. }
  186. #endif
  187. #endif /* ndef PROJ_API_H */
  188. #endif /* ndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY */
上海开阖软件有限公司 沪ICP备12045867号-1