31 #ifndef OGR_P_H_INCLUDED
32 #define OGR_P_H_INCLUDED
49 #define OGR_GEOMETRY_DEFAULT_NON_EMPTY_NAME "_ogr_geometry_"
52 #define OGR_SWAP(x) (x == wkbNDR)
54 #define OGR_SWAP(x) (x == wkbXDR)
58 #define POSTGIS15_CURVEPOLYGON 13
59 #define POSTGIS15_MULTICURVE 14
60 #define POSTGIS15_MULTISURFACE 15
63 #ifdef GDAL_COMPILATION
64 #define wkb25DBitInternalUse 0x80000000
71 #ifdef OGR_GEOMETRY_H_INCLUDED
72 #define OGR_WKT_TOKEN_MAX 64
74 const char CPL_DLL *OGRWktReadToken(
const char *pszInput,
char *pszToken);
76 const char CPL_DLL *OGRWktReadPoints(
const char *pszInput,
78 int *pnMaxPoints,
int *pnReadPoints);
81 OGRWktReadPointsM(
const char *pszInput,
OGRRawPoint **ppaoPoints,
82 double **ppadfZ,
double **ppadfM,
85 int *pnMaxPoints,
int *pnReadPoints);
87 void CPL_DLL OGRMakeWktCoordinate(
char *,
double,
double,
double,
int);
88 std::string CPL_DLL OGRMakeWktCoordinate(
double,
double,
double,
int,
90 void CPL_DLL OGRMakeWktCoordinateM(
char *,
double,
double,
double,
double,
92 std::string CPL_DLL OGRMakeWktCoordinateM(
double,
double,
double,
double,
98 void CPL_DLL OGRFormatDouble(
char *pszBuffer,
int nBufferLen,
double dfVal,
99 char chDecimalSep,
int nPrecision = 15,
100 char chConversionSpecifier =
'f');
102 #ifdef OGR_GEOMETRY_H_INCLUDED
103 std::string CPL_DLL OGRFormatDouble(
double val,
const OGRWktOptions &opts);
106 int OGRFormatFloat(
char *pszBuffer,
int nBufferLen,
float fVal,
int nPrecision,
107 char chConversionSpecifier);
116 int CPL_DLL OGRTimezoneToTZFlag(
const char *pszTZ,
117 bool bEmitErrorIfUnhandledFormat);
118 std::string CPL_DLL OGRTZFlagToTimezone(
int nTZFlag,
119 const char *pszUTCRepresentation);
121 int CPL_DLL OGRGetDayOfWeek(
int day,
int month,
int year);
122 int CPL_DLL OGRParseXMLDateTime(
const char *pszXMLDateTime,
OGRField *psField);
123 int CPL_DLL OGRParseRFC822DateTime(
const char *pszRFC822DateTime,
125 char CPL_DLL *OGRGetRFC822DateTime(
const OGRField *psField);
126 char CPL_DLL *OGRGetXMLDateTime(
const OGRField *psField);
127 char CPL_DLL *OGRGetXMLDateTime(
const OGRField *psField,
128 bool bAlwaysMillisecond);
130 #define OGR_SIZEOF_ISO8601_DATETIME_BUFFER 30
132 OGRGetISO8601DateTime(
const OGRField *psField,
bool bAlwaysMillisecond,
133 char szBuffer[OGR_SIZEOF_ISO8601_DATETIME_BUFFER]);
136 enum class OGRISO8601Precision
157 char szBuffer[OGR_SIZEOF_ISO8601_DATETIME_BUFFER]);
158 char CPL_DLL *OGRGetXML_UTF8_EscapedString(
const char *pszString);
159 bool CPL_DLL OGRParseDateTimeYYYYMMDDTHHMMZ(
const char *pszInput,
size_t nLen,
161 bool CPL_DLL OGRParseDateTimeYYYYMMDDTHHMMSSZ(
const char *pszInput,
size_t nLen,
163 bool CPL_DLL OGRParseDateTimeYYYYMMDDTHHMMSSsssZ(
const char *pszInput,
167 int OGRCompareDate(
const OGRField *psFirstTuple,
172 int CPL_DLL OGRGeneralCmdLineProcessor(
int nArgc,
char ***ppapszArgv,
179 #define SPF_OGR_GEOMETRY 1
180 #define SPF_OGR_STYLE 2
181 #define SPF_OGR_GEOM_WKT 3
182 #define SPF_OGR_GEOM_AREA 4
183 #define SPECIAL_FIELD_COUNT 5
185 extern const char *
const SpecialFieldNames[SPECIAL_FIELD_COUNT];
187 #ifdef SWQ_H_INCLUDED_
188 extern const swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT];
195 OGRErr CPL_DLL OSRGetEllipsoidInfo(
int,
char **,
double *,
double *);
198 double OGRFastAtof(
const char *pszStr);
200 OGRErr CPL_DLL OGRCheckPermutation(
const int *panPermutation,
int nSize);
205 int nPseudoBoolGetSecondaryGeometryOption,
206 int nRecLevel = 0,
int nSRSDimension = 0,
207 bool bIgnoreGSG =
false,
208 bool bOrientation =
true,
209 bool bFaceHoleNegative =
false);
216 int *pnSRID,
int bIsPostGIS1_EWKB);
217 OGRGeometry CPL_DLL *OGRGeometryFromHexEWKB(
const char *pszBytea,
int *pnSRID,
218 int bIsPostGIS1_EWKB);
219 char CPL_DLL *OGRGeometryToHexEWKB(
OGRGeometry *poGeometry,
int nSRSId,
220 int nPostGISMajor,
int nPostGISMinor);
226 OGRErr CPL_DLL OGRReadWKBGeometryType(
const unsigned char *pabyData,
234 OGRErr CPL_DLL OGRReadWKTGeometryType(
const char *pszWKT,