/Proj4/proj_api.h

http://github.com/route-me/route-me · C Header · 157 lines · 58 code · 15 blank · 84 comment · 0 complexity · 94d730006ea286681adff2557dbe5897 MD5 · raw file

  1. /******************************************************************************
  2. * $Id: proj_api.h,v 1.16 2007/11/29 21:07:49 fwarmerdam Exp $
  3. *
  4. * Project: PROJ.4
  5. * Purpose: Public (application) include file for PROJ.4 API, and constants.
  6. * Author: Frank Warmerdam, <warmerdam@pobox.com>
  7. *
  8. ******************************************************************************
  9. * Copyright (c) 2001, Frank Warmerdam <warmerdam@pobox.com>
  10. *
  11. * Permission is hereby granted, free of charge, to any person obtaining a
  12. * copy of this software and associated documentation files (the "Software"),
  13. * to deal in the Software without restriction, including without limitation
  14. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  15. * and/or sell copies of the Software, and to permit persons to whom the
  16. * Software is furnished to do so, subject to the following conditions:
  17. *
  18. * The above copyright notice and this permission notice shall be included
  19. * in all copies or substantial portions of the Software.
  20. *
  21. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  22. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  24. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  25. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  26. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  27. * DEALINGS IN THE SOFTWARE.
  28. ******************************************************************************
  29. *
  30. * $Log: proj_api.h,v $
  31. * Revision 1.16 2007/11/29 21:07:49 fwarmerdam
  32. * prepare for 4.6.0 release
  33. *
  34. * Revision 1.15 2007/08/20 13:40:06 fwarmerdam
  35. * avoid warnings in c++ for some prototypes
  36. *
  37. * Revision 1.14 2006/04/20 04:19:59 fwarmerdam
  38. * updated version
  39. *
  40. * Revision 1.13 2004/10/30 02:33:47 fwarmerdam
  41. * Updated release version.
  42. *
  43. * Revision 1.12 2004/09/16 15:14:01 fwarmerdam
  44. * * src/pj_open_lib.c: added pj_set_searchpath() provided by Eric Miller.
  45. *
  46. * Revision 1.11 2004/07/28 23:23:49 warmerda
  47. * Changed ra to es in declarations for pj_geocentric_to_geodetic()
  48. * and pj_geodetic_to_geocentric() as suggested by Britton Kerin.
  49. *
  50. * Revision 1.10 2004/05/04 03:28:01 warmerda
  51. * Updated version.
  52. *
  53. * Revision 1.9 2004/04/15 13:56:24 warmerda
  54. * added pj_get_release
  55. *
  56. * Revision 1.8 2003/03/31 14:52:38 warmerda
  57. * updated to 4.4.7
  58. *
  59. * Revision 1.7 2002/12/14 20:14:35 warmerda
  60. * added geocentric support
  61. *
  62. * Revision 1.6 2002/06/11 18:08:25 warmerda
  63. * Added the pj_get_def() function
  64. *
  65. * Revision 1.5 2002/01/09 14:36:22 warmerda
  66. * updated to 4.4.5
  67. *
  68. * Revision 1.4 2001/09/15 22:55:28 warmerda
  69. * final prep for 4.4.4 release
  70. *
  71. * Revision 1.3 2001/08/23 20:25:55 warmerda
  72. * added pj_set_finder function
  73. *
  74. * Revision 1.2 2001/06/02 03:35:36 warmerda
  75. * added pj_get_errno_ref()
  76. *
  77. * Revision 1.1 2001/04/06 01:24:22 warmerda
  78. * New
  79. *
  80. */
  81. /* General projections header file */
  82. #ifndef PROJ_API_H
  83. #define PROJ_API_H
  84. /* standard inclusions */
  85. #include <math.h>
  86. #include <stdlib.h>
  87. #ifdef __cplusplus
  88. extern "C" {
  89. #endif
  90. /* Try to update this every version! */
  91. #define PJ_VERSION 460
  92. extern char const pj_release[]; /* global release id string */
  93. #define RAD_TO_DEG 57.29577951308232
  94. #define DEG_TO_RAD .0174532925199432958
  95. extern int pj_errno; /* global error return code */
  96. #if !defined(PROJECTS_H)
  97. typedef struct { double u, v; } projUV;
  98. typedef void *projPJ;
  99. #define projXY projUV
  100. #define projLP projUV
  101. #else
  102. typedef PJ *projPJ;
  103. # define projXY XY
  104. # define projLP LP
  105. #endif
  106. /* procedure prototypes */
  107. projXY pj_fwd(projLP, projPJ);
  108. projLP pj_inv(projXY, projPJ);
  109. int pj_transform( projPJ src, projPJ dst, long point_count, int point_offset,
  110. double *x, double *y, double *z );
  111. int pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset,
  112. double *x, double *y, double *z );
  113. int pj_geocentric_to_geodetic( double a, double es,
  114. long point_count, int point_offset,
  115. double *x, double *y, double *z );
  116. int pj_geodetic_to_geocentric( double a, double es,
  117. long point_count, int point_offset,
  118. double *x, double *y, double *z );
  119. int pj_compare_datums( projPJ srcdefn, projPJ dstdefn );
  120. int pj_apply_gridshift( const char *, int,
  121. long point_count, int point_offset,
  122. double *x, double *y, double *z );
  123. void pj_deallocate_grids(void);
  124. int pj_is_latlong(projPJ);
  125. int pj_is_geocent(projPJ);
  126. void pj_pr_list(projPJ);
  127. void pj_free(projPJ);
  128. void pj_set_finder( const char *(*)(const char *) );
  129. void pj_set_searchpath ( int count, const char **path );
  130. projPJ pj_init(int, char **);
  131. projPJ pj_init_plus(const char *);
  132. char *pj_get_def(projPJ, int);
  133. projPJ pj_latlong_from_proj( projPJ );
  134. void *pj_malloc(size_t);
  135. void pj_dalloc(void *);
  136. char *pj_strerrno(int);
  137. int *pj_get_errno_ref(void);
  138. const char *pj_get_release(void);
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142. #endif /* ndef PROJ_API_H */