31 #ifndef OGR_P_H_INCLUDED
32 #define OGR_P_H_INCLUDED
48 #define OGR_GEOMETRY_DEFAULT_NON_EMPTY_NAME "_ogr_geometry_"
51 #define OGR_SWAP(x) (x == wkbNDR)
53 #define OGR_SWAP(x) (x == wkbXDR)
57 #define POSTGIS15_CURVEPOLYGON 13
58 #define POSTGIS15_MULTICURVE 14
59 #define POSTGIS15_MULTISURFACE 15
62 #ifdef GDAL_COMPILATION
63 #define wkb25DBitInternalUse 0x80000000
70 #ifdef OGR_GEOMETRY_H_INCLUDED
71 #define OGR_WKT_TOKEN_MAX 64
73 const char CPL_DLL *OGRWktReadToken(
const char *pszInput,
char *pszToken);
75 const char CPL_DLL *OGRWktReadPoints(
const char *pszInput,
77 int *pnMaxPoints,
int *pnReadPoints);
80 OGRWktReadPointsM(
const char *pszInput,
OGRRawPoint **ppaoPoints,
81 double **ppadfZ,
double **ppadfM,
84 int *pnMaxPoints,
int *pnReadPoints);
86 void CPL_DLL OGRMakeWktCoordinate(
char *,
double,
double,
double,
int);
87 std::string CPL_DLL OGRMakeWktCoordinate(
double,
double,
double,
int,
89 void CPL_DLL OGRMakeWktCoordinateM(
char *,
double,
double,
double,
double,
91 std::string CPL_DLL OGRMakeWktCoordinateM(
double,
double,
double,
double,
97 void CPL_DLL OGRFormatDouble(
char *pszBuffer,
int nBufferLen,
double dfVal,
98 char chDecimalSep,
int nPrecision = 15,
99 char chConversionSpecifier =
'f');
100 std::string CPL_DLL OGRFormatDouble(
double val,
const OGRWktOptions &opts);
102 int OGRFormatFloat(
char *pszBuffer,
int nBufferLen,
float fVal,
int nPrecision,
103 char chConversionSpecifier);
111 int CPL_DLL OGRGetDayOfWeek(
int day,
int month,
int year);
112 int CPL_DLL OGRParseXMLDateTime(
const char *pszXMLDateTime,
OGRField *psField);
113 int CPL_DLL OGRParseRFC822DateTime(
const char *pszRFC822DateTime,
115 char CPL_DLL *OGRGetRFC822DateTime(
const OGRField *psField);
116 char CPL_DLL *OGRGetXMLDateTime(
const OGRField *psField);
117 char CPL_DLL *OGRGetXMLDateTime(
const OGRField *psField,
118 bool bAlwaysMillisecond);
120 #define OGR_SIZEOF_ISO8601_DATETIME_BUFFER 30
122 OGRGetISO8601DateTime(
const OGRField *psField,
bool bAlwaysMillisecond,
123 char szBuffer[OGR_SIZEOF_ISO8601_DATETIME_BUFFER]);
124 char CPL_DLL *OGRGetXML_UTF8_EscapedString(
const char *pszString);
125 bool CPL_DLL OGRParseDateTimeYYYYMMDDTHHMMSSZ(
const char *pszInput,
size_t nLen,
127 bool CPL_DLL OGRParseDateTimeYYYYMMDDTHHMMSSsssZ(
const char *pszInput,
131 int OGRCompareDate(
const OGRField *psFirstTuple,
136 int CPL_DLL OGRGeneralCmdLineProcessor(
int nArgc,
char ***ppapszArgv,
143 #define SPF_OGR_GEOMETRY 1
144 #define SPF_OGR_STYLE 2
145 #define SPF_OGR_GEOM_WKT 3
146 #define SPF_OGR_GEOM_AREA 4
147 #define SPECIAL_FIELD_COUNT 5
149 extern const char *
const SpecialFieldNames[SPECIAL_FIELD_COUNT];
151 #ifdef SWQ_H_INCLUDED_
152 extern const swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT];
159 OGRErr CPL_DLL OSRGetEllipsoidInfo(
int,
char **,
double *,
double *);
162 double OGRFastAtof(
const char *pszStr);
164 OGRErr CPL_DLL OGRCheckPermutation(
const int *panPermutation,
int nSize);
169 int nPseudoBoolGetSecondaryGeometryOption,
170 int nRecLevel = 0,
int nSRSDimension = 0,
171 bool bIgnoreGSG =
false,
172 bool bOrientation =
true,
173 bool bFaceHoleNegative =
false);
180 int *pnSRID,
int bIsPostGIS1_EWKB);
181 OGRGeometry CPL_DLL *OGRGeometryFromHexEWKB(
const char *pszBytea,
int *pnSRID,
182 int bIsPostGIS1_EWKB);
183 char CPL_DLL *OGRGeometryToHexEWKB(
OGRGeometry *poGeometry,
int nSRSId,
184 int nPostGISMajor,
int nPostGISMinor);
190 OGRErr CPL_DLL OGRReadWKBGeometryType(
const unsigned char *pabyData,
198 OGRErr CPL_DLL OGRReadWKTGeometryType(
const char *pszWKT,