OGR
ogr_p.h
1 /******************************************************************************
2  * $Id: ogr_p.h 23638 2011-12-22 21:02:56Z rouault $
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: Some private helper functions and stuff for OGR implementation.
6  * Author: Frank Warmerdam, warmerdam@pobox.com
7  *
8  ******************************************************************************
9  * Copyright (c) 1999, Frank Warmerdam
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 #ifndef OGR_P_H_INCLUDED
31 #define OGR_P_H_INCLUDED
32 
33 /* -------------------------------------------------------------------- */
34 /* Include the common portability library ... lets us do lots */
35 /* of stuff easily. */
36 /* -------------------------------------------------------------------- */
37 
38 #include "cpl_string.h"
39 #include "cpl_conv.h"
40 #include "cpl_minixml.h"
41 
42 #include "ogr_core.h"
43 #include "ogr_geometry.h"
44 
45 #ifdef CPL_MSB
46 # define OGR_SWAP(x) (x == wkbNDR)
47 #else
48 # define OGR_SWAP(x) (x == wkbXDR)
49 #endif
50 
51 /* -------------------------------------------------------------------- */
52 /* helper function for parsing well known text format vector objects.*/
53 /* -------------------------------------------------------------------- */
54 
55 #ifdef _OGR_GEOMETRY_H_INCLUDED
56 #define OGR_WKT_TOKEN_MAX 64
57 
58 const char CPL_DLL * OGRWktReadToken( const char * pszInput, char * pszToken );
59 
60 const char CPL_DLL * OGRWktReadPoints( const char * pszInput,
61  OGRRawPoint **ppaoPoints,
62  double **ppadfZ,
63  int * pnMaxPoints,
64  int * pnReadPoints );
65 
66 void CPL_DLL OGRMakeWktCoordinate( char *, double, double, double, int );
67 
68 #endif
69 
70 void OGRFormatDouble( char *pszBuffer, int nBufferLen, double dfVal, char chDecimalSep, int nPrecision = 15 );
71 
72 /* -------------------------------------------------------------------- */
73 /* Date-time parsing and processing functions */
74 /* -------------------------------------------------------------------- */
75 
76 /* Internal use by OGR drivers only, CPL_DLL is just there in case */
77 /* they are compiled as plugins */
78 int CPL_DLL OGRGetDayOfWeek(int day, int month, int year);
79 int CPL_DLL OGRParseXMLDateTime( const char* pszXMLDateTime,
80  int *pnYear, int *pnMonth, int *pnDay,
81  int *pnHour, int *pnMinute, float* pfSecond, int *pnTZ);
82 int CPL_DLL OGRParseRFC822DateTime( const char* pszRFC822DateTime,
83  int *pnYear, int *pnMonth, int *pnDay,
84  int *pnHour, int *pnMinute, int *pnSecond, int *pnTZ);
85 char CPL_DLL * OGRGetRFC822DateTime(int year, int month, int day,
86  int hour, int minute, int second, int TZ);
87 char CPL_DLL * OGRGetXMLDateTime(int year, int month, int day,
88  int hour, int minute, int second, int TZFlag);
89 char CPL_DLL * OGRGetXML_UTF8_EscapedString(const char* pszString);
90 
91 int OGRCompareDate( OGRField *psFirstTuple,
92  OGRField *psSecondTuple ); /* used by ogr_gensql.cpp and ogrfeaturequery.cpp */
93 
94 /* General utility option processing. */
95 int CPL_DLL OGRGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, int nOptions );
96 
97 /************************************************************************/
98 /* Support for special attributes (feature query and selection) */
99 /************************************************************************/
100 #define SPF_FID 0
101 #define SPF_OGR_GEOMETRY 1
102 #define SPF_OGR_STYLE 2
103 #define SPF_OGR_GEOM_WKT 3
104 #define SPF_OGR_GEOM_AREA 4
105 #define SPECIAL_FIELD_COUNT 5
106 
107 extern const char* SpecialFieldNames[SPECIAL_FIELD_COUNT];
108 
109 #ifdef _SWQ_H_INCLUDED_
110 extern const swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT];
111 #endif
112 
113 /************************************************************************/
114 /* Some SRS related stuff, search in SRS data files. */
115 /************************************************************************/
116 
117 OGRErr CPL_DLL OSRGetEllipsoidInfo( int, char **, double *, double *);
118 
119 /* Fast atof function */
120 double OGRFastAtof(const char* pszStr);
121 
122 OGRErr CPL_DLL OGRCheckPermutation(int* panPermutation, int nSize);
123 
124 /* GML related */
125 
126 OGRGeometry *GML2OGRGeometry_XMLNode( const CPLXMLNode *psNode,
127  int bGetSecondaryGeometryOption,
128  int nRecLevel = 0,
129  int bIgnoreGSG = FALSE,
130  int bOrientation = TRUE,
131  int bFaceHoleNegative = FALSE );
132 
133 #endif /* ndef OGR_P_H_INCLUDED */

Generated for GDAL by doxygen 1.8.1.1.