00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef OGR_P_H_INCLUDED
00032 #define OGR_P_H_INCLUDED
00033
00034
00035
00036
00037
00038
00039 #include "cpl_string.h"
00040 #include "cpl_conv.h"
00041 #include "cpl_minixml.h"
00042
00043 #include "ogr_core.h"
00044 #include "ogr_geometry.h"
00045 #include "ogr_feature.h"
00046
00047
00048 #define OGR_GEOMETRY_DEFAULT_NON_EMPTY_NAME "_ogr_geometry_"
00049
00050 #ifdef CPL_MSB
00051 # define OGR_SWAP(x) (x == wkbNDR)
00052 #else
00053 # define OGR_SWAP(x) (x == wkbXDR)
00054 #endif
00055
00056
00057 #define POSTGIS15_CURVEPOLYGON 13
00058 #define POSTGIS15_MULTICURVE 14
00059 #define POSTGIS15_MULTISURFACE 15
00060
00061
00062 #ifdef GDAL_COMPILATION
00063 #define wkb25DBitInternalUse 0x80000000
00064 #endif
00065
00066
00067
00068
00069
00070 #ifdef OGR_GEOMETRY_H_INCLUDED
00071 #define OGR_WKT_TOKEN_MAX 64
00072
00073 const char CPL_DLL * OGRWktReadToken( const char * pszInput, char * pszToken );
00074
00075 const char CPL_DLL * OGRWktReadPoints( const char * pszInput,
00076 OGRRawPoint **ppaoPoints,
00077 double **ppadfZ,
00078 int * pnMaxPoints,
00079 int * pnReadPoints );
00080
00081 const char CPL_DLL * OGRWktReadPointsM( const char * pszInput,
00082 OGRRawPoint **ppaoPoints,
00083 double **ppadfZ,
00084 double **ppadfM,
00085 int * flags,
00086 int * pnMaxPoints,
00087 int * pnReadPoints );
00088
00089 void CPL_DLL OGRMakeWktCoordinate( char *, double, double, double, int );
00090 void CPL_DLL OGRMakeWktCoordinateM( char *, double, double, double, double, OGRBoolean, OGRBoolean );
00091
00092 #endif
00093
00094 void OGRFormatDouble( char *pszBuffer, int nBufferLen, double dfVal,
00095 char chDecimalSep, int nPrecision = 15, char chConversionSpecifier = 'f' );
00096
00097
00098
00099
00100
00101
00102
00103 int CPL_DLL OGRGetDayOfWeek(int day, int month, int year);
00104 int CPL_DLL OGRParseXMLDateTime( const char* pszXMLDateTime,
00105 OGRField* psField );
00106 int CPL_DLL OGRParseRFC822DateTime( const char* pszRFC822DateTime,
00107 OGRField* psField );
00108 char CPL_DLL * OGRGetRFC822DateTime(const OGRField* psField);
00109 char CPL_DLL * OGRGetXMLDateTime(const OGRField* psField);
00110 char CPL_DLL * OGRGetXML_UTF8_EscapedString(const char* pszString);
00111
00112 int OGRCompareDate( OGRField *psFirstTuple,
00113 OGRField *psSecondTuple );
00114
00115
00116 int CPL_DLL OGRGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, int nOptions );
00117
00118
00119
00120
00121 #define SPF_FID 0
00122 #define SPF_OGR_GEOMETRY 1
00123 #define SPF_OGR_STYLE 2
00124 #define SPF_OGR_GEOM_WKT 3
00125 #define SPF_OGR_GEOM_AREA 4
00126 #define SPECIAL_FIELD_COUNT 5
00127
00128 extern const char* const SpecialFieldNames[SPECIAL_FIELD_COUNT];
00129
00130 #ifdef SWQ_H_INCLUDED_
00131 extern const swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT];
00132 #endif
00133
00134
00135
00136
00137
00138 OGRErr CPL_DLL OSRGetEllipsoidInfo( int, char **, double *, double *);
00139
00140
00141 double OGRFastAtof(const char* pszStr);
00142
00143 OGRErr CPL_DLL OGRCheckPermutation(int* panPermutation, int nSize);
00144
00145
00146
00147 OGRGeometry *GML2OGRGeometry_XMLNode( const CPLXMLNode *psNode,
00148 int nPseudoBoolGetSecondaryGeometryOption,
00149 int nRecLevel = 0,
00150 int nSRSDimension = 0,
00151 bool bIgnoreGSG = false,
00152 bool bOrientation = true,
00153 bool bFaceHoleNegative = false);
00154
00155
00156
00157
00158
00159 OGRGeometry CPL_DLL *OGRGeometryFromEWKB( GByte *pabyWKB, int nLength, int* pnSRID,
00160 int bIsPostGIS1_EWKB );
00161 OGRGeometry CPL_DLL *OGRGeometryFromHexEWKB( const char *pszBytea, int* pnSRID,
00162 int bIsPostGIS1_EWKB );
00163 char CPL_DLL * OGRGeometryToHexEWKB( OGRGeometry * poGeometry, int nSRSId,
00164 int nPostGISMajor, int nPostGISMinor );
00165
00166
00167
00168
00169
00170 OGRErr OGRReadWKBGeometryType( unsigned char * pabyData,
00171 OGRwkbVariant wkbVariant,
00172 OGRwkbGeometryType *eGeometryType );
00173
00174
00175
00176
00177
00178 void CPL_DLL OGRUpdateFieldType( OGRFieldDefn* poFDefn,
00179 OGRFieldType eNewType,
00180 OGRFieldSubType eNewSubType );
00181
00182 #endif