PageRenderTime 31ms CodeModel.GetById 14ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 82/* General projections header file */
 83#ifndef PROJ_API_H
 84#define PROJ_API_H
 85
 86/* standard inclusions */
 87#include <math.h>
 88#include <stdlib.h>
 89
 90#ifdef __cplusplus
 91extern "C" {
 92#endif
 93
 94/* Try to update this every version! */
 95#define PJ_VERSION 460
 96
 97extern char const pj_release[]; /* global release id string */
 98
 99#define RAD_TO_DEG	57.29577951308232
100#define DEG_TO_RAD	.0174532925199432958
101
102
103extern int pj_errno;	/* global error return code */
104
105#if !defined(PROJECTS_H)
106    typedef struct { double u, v; } projUV;
107    typedef void *projPJ;
108    #define projXY projUV
109    #define projLP projUV
110#else
111    typedef PJ *projPJ;
112#   define projXY	XY
113#   define projLP       LP
114#endif
115
116/* procedure prototypes */
117
118projXY pj_fwd(projLP, projPJ);
119projLP pj_inv(projXY, projPJ);
120
121int pj_transform( projPJ src, projPJ dst, long point_count, int point_offset,
122                  double *x, double *y, double *z );
123int pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset,
124                        double *x, double *y, double *z );
125int pj_geocentric_to_geodetic( double a, double es,
126                               long point_count, int point_offset,
127                               double *x, double *y, double *z );
128int pj_geodetic_to_geocentric( double a, double es,
129                               long point_count, int point_offset,
130                               double *x, double *y, double *z );
131int pj_compare_datums( projPJ srcdefn, projPJ dstdefn );
132int pj_apply_gridshift( const char *, int, 
133                        long point_count, int point_offset,
134                        double *x, double *y, double *z );
135void pj_deallocate_grids(void);
136int pj_is_latlong(projPJ);
137int pj_is_geocent(projPJ);
138void pj_pr_list(projPJ);
139void pj_free(projPJ);
140void pj_set_finder( const char *(*)(const char *) );
141void pj_set_searchpath ( int count, const char **path );
142projPJ pj_init(int, char **);
143projPJ pj_init_plus(const char *);
144char *pj_get_def(projPJ, int);
145projPJ pj_latlong_from_proj( projPJ );
146void *pj_malloc(size_t);
147void pj_dalloc(void *);
148char *pj_strerrno(int);
149int *pj_get_errno_ref(void);
150const char *pj_get_release(void);
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif /* ndef PROJ_API_H */
157