OGR
ogr_p.h
1 /******************************************************************************
2  * $Id: ogr_p.h 27044 2014-03-16 23:41:27Z 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  * Copyright (c) 2008-2014, Even Rouault <even dot rouault at mines-paris dot org>
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28  * DEALINGS IN THE SOFTWARE.
29  ****************************************************************************/
30 
31 #ifndef OGR_P_H_INCLUDED
32 #define OGR_P_H_INCLUDED
33 
34 /* -------------------------------------------------------------------- */
35 /* Include the common portability library ... lets us do lots */
36 /* of stuff easily. */
37 /* -------------------------------------------------------------------- */
38 
39 #include "cpl_string.h"
40 #include "cpl_conv.h"
41 #include "cpl_minixml.h"
42 
43 #include "ogr_core.h"
44 #include "ogr_geometry.h"
45 
46 /* A default name for the default geometry column, instead of '' */
47 #define OGR_GEOMETRY_DEFAULT_NON_EMPTY_NAME "_ogr_geometry_"
48 
49 #ifdef CPL_MSB
50 # define OGR_SWAP(x) (x == wkbNDR)
51 #else
52 # define OGR_SWAP(x) (x == wkbXDR)
53 #endif
54 
55 /* -------------------------------------------------------------------- */
56 /* helper function for parsing well known text format vector objects.*/
57 /* -------------------------------------------------------------------- */
58 
59 #ifdef _OGR_GEOMETRY_H_INCLUDED
60 #define OGR_WKT_TOKEN_MAX 64
61 
62 const char CPL_DLL * OGRWktReadToken( const char * pszInput, char * pszToken );
63 
64 const char CPL_DLL * OGRWktReadPoints( const char * pszInput,
65  OGRRawPoint **ppaoPoints,
66  double **ppadfZ,
67  int * pnMaxPoints,
68  int * pnReadPoints );
69 
70 void CPL_DLL OGRMakeWktCoordinate( char *, double, double, double, int );
71 
72 #endif
73 
74 void OGRFormatDouble( char *pszBuffer, int nBufferLen, double dfVal, char chDecimalSep, int nPrecision = 15 );
75 
76 /* -------------------------------------------------------------------- */
77 /* Date-time parsing and processing functions */
78 /* -------------------------------------------------------------------- */
79 
80 /* Internal use by OGR drivers only, CPL_DLL is just there in case */
81 /* they are compiled as plugins */
82 int CPL_DLL OGRGetDayOfWeek(int day, int month, int year);
83 int CPL_DLL OGRParseXMLDateTime( const char* pszXMLDateTime,
84  int *pnYear, int *pnMonth, int *pnDay,
85  int *pnHour, int *pnMinute, float* pfSecond, int *pnTZ);
86 int CPL_DLL OGRParseRFC822DateTime( const char* pszRFC822DateTime,
87  int *pnYear, int *pnMonth, int *pnDay,
88  int *pnHour, int *pnMinute, int *pnSecond, int *pnTZ);
89 char CPL_DLL * OGRGetRFC822DateTime(int year, int month, int day,
90  int hour, int minute, int second, int TZ);
91 char CPL_DLL * OGRGetXMLDateTime(int year, int month, int day,
92  int hour, int minute, int second, int TZFlag);
93 char CPL_DLL * OGRGetXML_UTF8_EscapedString(const char* pszString);
94 
95 int OGRCompareDate( OGRField *psFirstTuple,
96  OGRField *psSecondTuple ); /* used by ogr_gensql.cpp and ogrfeaturequery.cpp */
97 
98 /* General utility option processing. */
99 int CPL_DLL OGRGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, int nOptions );
100 
101 /************************************************************************/
102 /* Support for special attributes (feature query and selection) */
103 /************************************************************************/
104 #define SPF_FID 0
105 #define SPF_OGR_GEOMETRY 1
106 #define SPF_OGR_STYLE 2
107 #define SPF_OGR_GEOM_WKT 3
108 #define SPF_OGR_GEOM_AREA 4
109 #define SPECIAL_FIELD_COUNT 5
110 
111 extern const char* SpecialFieldNames[SPECIAL_FIELD_COUNT];
112 
113 #ifdef _SWQ_H_INCLUDED_
114 extern const swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT];
115 #endif
116 
117 /************************************************************************/
118 /* Some SRS related stuff, search in SRS data files. */
119 /************************************************************************/
120 
121 OGRErr CPL_DLL OSRGetEllipsoidInfo( int, char **, double *, double *);
122 
123 /* Fast atof function */
124 double OGRFastAtof(const char* pszStr);
125 
126 OGRErr CPL_DLL OGRCheckPermutation(int* panPermutation, int nSize);
127 
128 /* GML related */
129 
130 OGRGeometry *GML2OGRGeometry_XMLNode( const CPLXMLNode *psNode,
131  int bGetSecondaryGeometryOption,
132  int nRecLevel = 0,
133  int bIgnoreGSG = FALSE,
134  int bOrientation = TRUE,
135  int bFaceHoleNegative = FALSE );
136 
137 /************************************************************************/
138 /* PostGIS EWKB encoding */
139 /************************************************************************/
140 
141 OGRGeometry CPL_DLL *OGRGeometryFromEWKB( GByte *pabyWKB, int nLength, int* pnSRID );
142 OGRGeometry CPL_DLL *OGRGeometryFromHexEWKB( const char *pszBytea, int* pnSRID );
143 char CPL_DLL * OGRGeometryToHexEWKB( OGRGeometry * poGeometry, int nSRSId );
144 
145 /************************************************************************/
146 /* WKB Type Handling encoding */
147 /************************************************************************/
148 
149 OGRErr OGRReadWKBGeometryType( unsigned char * pabyData, OGRwkbGeometryType *eGeometryType, OGRBoolean *b3D );
150 
151 #endif /* ndef OGR_P_H_INCLUDED */
Definition: cpl_minixml.h:65
Definition: ogr_geometry.h:47
OGRwkbGeometryType
Definition: ogr_core.h:308
Definition: ogr_geometry.h:79
Definition: ogr_core.h:427

Generated for GDAL by doxygen 1.8.11.