OGR
ogr_gensql.h
1 /******************************************************************************
2  * $Id: ogr_gensql.h 3e9d922f6235cbf10dcc765d1326add45431fb8a 2018-04-02 16:53:25 +0200 Even Rouault $
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: Classes related to generic implementation of ExecuteSQL().
6  * Author: Frank Warmerdam, warmerdam@pobox.com
7  *
8  ******************************************************************************
9  * Copyright (c) 2002, Frank Warmerdam
10  * Copyright (c) 2010-2013, 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_GENSQL_H_INCLUDED
32 #define OGR_GENSQL_H_INCLUDED
33 
34 #include "ogrsf_frmts.h"
35 #include "swq.h"
36 #include "cpl_hash_set.h"
37 #include "cpl_string.h"
38 
39 #include <vector>
40 
43 #define GEOM_FIELD_INDEX_TO_ALL_FIELD_INDEX(poFDefn, iGeom) \
44  ((poFDefn)->GetFieldCount() + SPECIAL_FIELD_COUNT + (iGeom))
45 
46 #define IS_GEOM_FIELD_INDEX(poFDefn, idx) \
47  (((idx) >= (poFDefn)->GetFieldCount() + SPECIAL_FIELD_COUNT) && \
48  ((idx) < (poFDefn)->GetFieldCount() + SPECIAL_FIELD_COUNT + (poFDefn)->GetGeomFieldCount()))
49 
50 #define ALL_FIELD_INDEX_TO_GEOM_FIELD_INDEX(poFDefn, idx) \
51  ((idx) - ((poFDefn)->GetFieldCount() + SPECIAL_FIELD_COUNT))
52 
53 /************************************************************************/
54 /* OGRGenSQLResultsLayer */
55 /************************************************************************/
56 
57 class OGRGenSQLResultsLayer final: public OGRLayer
58 {
59  private:
60  GDALDataset *poSrcDS;
61  OGRLayer *poSrcLayer;
62  void *pSelectInfo;
63 
64  char *pszWHERE;
65 
66  OGRLayer **papoTableLayers;
67 
68  OGRFeatureDefn *poDefn;
69 
70  int *panGeomFieldToSrcGeomField;
71 
72  size_t nIndexSize;
73  GIntBig *panFIDIndex;
74  int bOrderByValid;
75 
76  GIntBig nNextIndexFID;
77  OGRFeature *poSummaryFeature;
78 
79  int iFIDFieldIndex;
80 
81  int nExtraDSCount;
82  GDALDataset **papoExtraDS;
83 
84  GIntBig nIteratedFeatures;
85  std::vector<CPLString> m_oDistinctList;
86 
87  int PrepareSummary();
88 
89  OGRFeature *TranslateFeature( OGRFeature * );
90  void CreateOrderByIndex();
91  void ReadIndexFields( OGRFeature* poSrcFeat,
92  int nOrderItems,
93  OGRField *pasIndexFields );
94  void SortIndexSection( const OGRField *pasIndexFields,
95  GIntBig *panMerged,
96  size_t nStart, size_t nEntries );
97  void FreeIndexFields(OGRField *pasIndexFields,
98  size_t l_nIndexSize,
99  bool bFreeArray = true);
100  int Compare( const OGRField *pasFirst, const OGRField *pasSecond );
101 
102  void ClearFilters();
103  void ApplyFiltersToSource();
104 
105  void FindAndSetIgnoredFields();
106  void ExploreExprForIgnoredFields(swq_expr_node* expr, CPLHashSet* hSet);
107  void AddFieldDefnToSet(int iTable, int iColumn, CPLHashSet* hSet);
108 
109  int ContainGeomSpecialField(swq_expr_node* expr);
110 
111  void InvalidateOrderByIndex();
112 
113  int MustEvaluateSpatialFilterOnGenSQL();
114 
115  public:
116  OGRGenSQLResultsLayer( GDALDataset *poSrcDS,
117  void *pSelectInfo,
118  OGRGeometry *poSpatFilter,
119  const char *pszWHERE,
120  const char *pszDialect );
121  virtual ~OGRGenSQLResultsLayer();
122 
123  virtual OGRGeometry *GetSpatialFilter() override;
124 
125  virtual void ResetReading() override;
126  virtual OGRFeature *GetNextFeature() override;
127  virtual OGRErr SetNextByIndex( GIntBig nIndex ) override;
128  virtual OGRFeature *GetFeature( GIntBig nFID ) override;
129 
130  virtual OGRFeatureDefn *GetLayerDefn() override;
131 
132  virtual GIntBig GetFeatureCount( int bForce = TRUE ) override;
133  virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override { return GetExtent(0, psExtent, bForce); }
134  virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce = TRUE) override;
135 
136  virtual int TestCapability( const char * ) override;
137 
138  virtual void SetSpatialFilter( OGRGeometry * poGeom ) override { SetSpatialFilter(0, poGeom); }
139  virtual void SetSpatialFilter( int iGeomField, OGRGeometry * ) override;
140  virtual OGRErr SetAttributeFilter( const char * ) override;
141 };
142 
145 #endif /* ndef OGR_GENSQL_H_INCLUDED */
OGRSpatialReference::GetRoot
OGR_SRSNode * GetRoot()
Return root node.
Definition: ogr_spatialref.h:266
OGRSpatialReference::GetPrimeMeridian
double GetPrimeMeridian(char **) const CPL_WARN_DEPRECATED("Use GetPrimeMeridian( const char**) instead")
Fetch prime meridian info.
Definition: ogrspatialreference.cpp:1698
OGR_SRSNode::DestroyChild
void DestroyChild(int)
Definition: ogr_srsnode.cpp:291
SRS_PP_CENTRAL_MERIDIAN
#define SRS_PP_CENTRAL_MERIDIAN
Definition: ogr_srs_api.h:269
SRS_UA_DEGREE_CONV
#define SRS_UA_DEGREE_CONV
Definition: ogr_srs_api.h:446
OGR_SRSNode::GetChildCount
int GetChildCount() const
Definition: ogr_spatialref.h:86
CPLHashSetHashPointer
unsigned long CPLHashSetHashPointer(const void *elt)
Definition: cpl_hash_set.cpp:514
OGRSpatialReference::EPSGTreatsAsNorthingEasting
int EPSGTreatsAsNorthingEasting() const
This method returns TRUE if EPSG feels this projected coordinate system should be treated as having n...
Definition: ogr_fromepsg.cpp:2850
ogr_spatialref.h
OGRSpatialReference::GetEPSGGeogCS
int GetEPSGGeogCS() const
Definition: ogr_fromepsg.cpp:2545
CPLReadLineL
const char * CPLReadLineL(VSILFILE *)
Definition: cpl_conv.cpp:630
OGRSpatialReference::SetVertCS
OGRErr SetVertCS(const char *pszVertCSName, const char *pszVertDatumName, int nVertDatumClass=2005)
Set the user visible VERT_CS name.
Definition: ogrspatialreference.cpp:3391
OGRSpatialReference::SetMercator2SP
OGRErr SetMercator2SP(double dfStdP1, double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5379
OAO_North
@ OAO_North
Definition: ogr_srs_api.h:50
CPLGetLastErrorMsg
const char * CPLGetLastErrorMsg(void)
Definition: cpl_error.cpp:847
OGRSpatialReference::SetNode
OGRErr SetNode(const char *, const char *)
Set attribute value in spatial reference.
Definition: ogrspatialreference.cpp:920
OGRFeature::SetFID
virtual OGRErr SetFID(GIntBig nFIDIn)
Set the feature identifier.
Definition: ogrfeature.cpp:5436
OGR_RawField_IsNull
int OGR_RawField_IsNull(const OGRField *)
Returns whether a raw field is null.
Definition: ogrfeature.cpp:6960
cpl_error.h
OGRSpatialReference::SetMercator
OGRErr SetMercator(double dfCenterLat, double dfCenterLong, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5338
OGRFeature::SetNativeMediaType
void SetNativeMediaType(const char *pszNativeMediaType)
Sets the native media type for the feature.
Definition: ogrfeature.cpp:6887
OGRSpatialReference::Release
void Release()
Decrements the reference count by one, and destroy if zero.
Definition: ogrspatialreference.cpp:398
CPLEscapeString
char * CPLEscapeString(const char *pszString, int nLength, int nScheme)
Definition: cpl_string.cpp:2032
OGRSpatialReference::SetTOWGS84
OGRErr SetTOWGS84(double, double, double, double=0.0, double=0.0, double=0.0, double=0.0)
Set the Bursa-Wolf conversion to WGS84.
Definition: ogrspatialreference.cpp:7736
CPLFindFile
const char * CPLFindFile(const char *pszClass, const char *pszBasename)
Definition: cpl_findfile.cpp:177
OGRLayer::GetNextFeature
virtual OGRFeature * GetNextFeature() CPL_WARN_UNUSED_RESULT=0
Fetch the next available feature from this layer.
OGRLayer::ResetReading
virtual void ResetReading()=0
Reset feature reading to start on the first feature.
OFSTBoolean
@ OFSTBoolean
Definition: ogr_core.h:626
OGRSpatialReference::SetTMG
OGRErr SetTMG(double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:4199
CPLString::Printf
CPLSTRING_DLL CPLString & Printf(const char *pszFormat,...)
Definition: cplstring.cpp:67
OGRSpatialReference::SetEquirectangular
OGRErr SetEquirectangular(double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:4578
OGRSpatialReference::GetAuthorityCode
const char * GetAuthorityCode(const char *pszTargetKey) const
Get the authority code for a node.
Definition: ogrspatialreference.cpp:6183
VSI_REALLOC_VERBOSE
#define VSI_REALLOC_VERBOSE(pOldPtr, nNewSize)
Definition: cpl_vsi.h:285
OGRSpatialReference::SetLCC1SP
OGRErr SetLCC1SP(double dfCenterLat, double dfCenterLong, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5227
CPLHashSetNew
CPLHashSet * CPLHashSetNew(CPLHashSetHashFunc fnHashFunc, CPLHashSetEqualFunc fnEqualFunc, CPLHashSetFreeEltFunc fnFreeEltFunc)
Definition: cpl_hash_set.cpp:91
OGRSpatialReference::morphFromESRI
OGRErr morphFromESRI()
Convert in place from ESRI WKT format.
Definition: ogr_srs_esri.cpp:1971
cpl_hash_set.h
wkbMultiPolygon
@ wkbMultiPolygon
Definition: ogr_core.h:329
OGRSpatialReference::GetAttrValue
const char * GetAttrValue(const char *, int=0) const
Fetch indicated attribute of named node.
Definition: ogrspatialreference.cpp:545
CPLCalloc
void * CPLCalloc(size_t, size_t)
Definition: cpl_conv.cpp:138
OGRSpatialReference::SetExtension
OGRErr SetExtension(const char *pszTargetKey, const char *pszName, const char *pszValue)
Set extension value.
Definition: ogrspatialreference.cpp:8126
OGRGeometry::FromHandle
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Definition: ogr_geometry.h:516
OGRSpatialReference::FindMatches
OGRSpatialReferenceH * FindMatches(char **papszOptions, int *pnEntries, int **ppanMatchConfidence) const
Try to identify a match between the passed SRS and a related SRS in a catalog (currently EPSG only)
Definition: ogr_fromepsg.cpp:3411
CPLPopErrorHandler
void CPLPopErrorHandler(void)
Definition: cpl_error.cpp:1223
OGRFieldDefn::GetWidth
int GetWidth() const
Get the formatting width for this field.
Definition: ogr_feature.h:127
OGR_G_ForceToMultiLineString
OGRGeometryH OGR_G_ForceToMultiLineString(OGRGeometryH) CPL_WARN_UNUSED_RESULT
Convert to multilinestring.
Definition: ogrgeometryfactory.cpp:1294
OGRSpatialReference
Definition: ogr_spatialref.h:145
OGRSpatialReference::SetACEA
OGRErr SetACEA(double dfStdP1, double dfStdP2, double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:4233
OGRLayer::GetFeatureCount
virtual GIntBig GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition: ogrlayer.cpp:172
CPLsnprintf
int CPLsnprintf(char *str, size_t size, const char *fmt,...)
Definition: cpl_string.cpp:1337
OSRAutoIdentifyEPSG
OGRErr OSRAutoIdentifyEPSG(OGRSpatialReferenceH hSRS)
Set EPSG authority info if possible.
Definition: ogr_fromepsg.cpp:2758
OGRFeature::GetFieldAsString
const char * GetFieldAsString(int i) const
Fetch field value as a string.
Definition: ogrfeature.cpp:2297
OGRSpatialReference::Clone
OGRSpatialReference * Clone() const
Make a duplicate of this OGRSpatialReference.
Definition: ogrspatialreference.cpp:590
OFTDateTime
@ OFTDateTime
Definition: ogr_core.h:607
OGRSpatialReference::GetNormProjParm
double GetNormProjParm(const char *, double=0.0, OGRErr *=nullptr) const
Fetch a normalized projection parameter value.
Definition: ogrspatialreference.cpp:3924
OGRGeometry
Definition: ogr_geometry.h:286
OGRSpatialReference::IsSame
int IsSame(const OGRSpatialReference *) const
Do these two spatial references describe the same system ?
Definition: ogrspatialreference.cpp:6997
CPLResetExtension
const char * CPLResetExtension(const char *, const char *)
Definition: cpl_path.cpp:431
OGRSpatialReference::SetLinearUnits
OGRErr SetLinearUnits(const char *pszName, double dfInMeters)
Set the linear units for the projection.
Definition: ogrspatialreference.cpp:1304
CSLCount
int CSLCount(CSLConstList papszStrList)
Definition: cpl_string.cpp:147
VSIMkdir
int VSIMkdir(const char *pszPathname, long mode)
Create a directory.
Definition: cpl_vsil.cpp:333
OGRFeature::GetGeomFieldDefnRef
OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField)
Fetch definition for this geometry field.
Definition: ogr_feature.h:581
OGRLayer
Definition: ogrsf_frmts.h:70
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:336
OGRSpatialReference::SetPS
OGRErr SetPS(double dfCenterLat, double dfCenterLong, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5597
OGRSpatialReference::IsProjected
int IsProjected() const
Check if projected coordinate system.
Definition: ogrspatialreference.cpp:6453
OGR_SRSNode::SetValue
void SetValue(const char *)
Definition: ogr_srsnode.cpp:358
OGRFieldDefn::GetPrecision
int GetPrecision() const
Get the formatting precision for this field. This should normally be zero for fields of types other t...
Definition: ogr_feature.h:130
OGRLayer::GetSpatialFilter
virtual OGRGeometry * GetSpatialFilter()
This method returns the current spatial filter for this layer.
Definition: ogrlayer.cpp:1084
OGRFeature::SetNativeData
void SetNativeData(const char *pszNativeData)
Sets the native data for the feature.
Definition: ogrfeature.cpp:6831
OAO_East
@ OAO_East
Definition: ogr_srs_api.h:52
CPLRealloc
void * CPLRealloc(void *, size_t)
Definition: cpl_conv.cpp:225
OGRLayer::SetSpatialFilter
virtual void SetSpatialFilter(OGRGeometry *)
Set a new spatial filter.
Definition: ogrlayer.cpp:1112
OGRSpatialReference::SetPolyconic
OGRErr SetPolyconic(double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5560
OGRSpatialReference::SetLCCB
OGRErr SetLCCB(double dfStdP1, double dfStdP2, double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5265
OGRGeomFieldDefn::GetNameRef
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:203
OLCFastFeatureCount
#define OLCFastFeatureCount
Definition: ogr_core.h:752
OGRSpatialReference::GetUTMZone
int GetUTMZone(int *pbNorth=nullptr) const
Get utm zone information.
Definition: ogrspatialreference.cpp:5908
CPL_FRMT_GIB
#define CPL_FRMT_GIB
Definition: cpl_port.h:314
EQUAL
#define EQUAL(a, b)
Definition: cpl_port.h:559
VSIFCloseL
int VSIFCloseL(VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Close file.
Definition: cpl_vsil.cpp:928
OGRFieldDefn::GetNameRef
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:113
OGRSpatialReference::FixupOrdering
OGRErr FixupOrdering()
Correct parameter ordering to match CT Specification.
Definition: ogrspatialreference.cpp:7961
OGR_SRSNode::GetValue
const char * GetValue() const
Definition: ogr_spatialref.h:100
OGRSpatialReference::SetTargetLinearUnits
OGRErr SetTargetLinearUnits(const char *pszTargetKey, const char *pszName, double dfInMeters)
Set the linear units for the projection.
Definition: ogrspatialreference.cpp:1358
OGRLayer::GetLayerDefn
virtual OGRFeatureDefn * GetLayerDefn()=0
Fetch the schema information for this layer.
OGRFeatureDefn::GetFieldDefn
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition: ogrfeaturedefn.cpp:329
OGRSpatialReference::SetStatePlane
OGRErr SetStatePlane(int nZone, int bNAD83=TRUE, const char *pszOverrideUnitName=nullptr, double dfOverrideUnit=0.0)
Set State Plane projection definition.
Definition: ogr_fromepsg.cpp:2395
SRS_PT_LABORDE_OBLIQUE_MERCATOR
#define SRS_PT_LABORDE_OBLIQUE_MERCATOR
Definition: ogr_srs_api.h:152
wkbFlatten
#define wkbFlatten(x)
Definition: ogr_core.h:440
OGRSpatialReference::GetAuthorityName
const char * GetAuthorityName(const char *pszTargetKey) const
Get the authority name for a node.
Definition: ogrspatialreference.cpp:6255
CSLGetField
const char * CSLGetField(CSLConstList, int)
Definition: cpl_string.cpp:173
OGR_RawField_IsUnset
int OGR_RawField_IsUnset(const OGRField *)
Returns whether a raw field is unset.
Definition: ogrfeature.cpp:6939
CPLPushErrorHandler
void CPLPushErrorHandler(CPLErrorHandler)
Definition: cpl_error.cpp:1166
CPLAssert
#define CPLAssert(expr)
Definition: cpl_error.h:182
CPLHashSetInsert
int CPLHashSetInsert(CPLHashSet *set, void *elt)
Definition: cpl_hash_set.cpp:355
OGRFeature::SetField
void SetField(int i, int nValue)
Set field to integer value.
Definition: ogrfeature.cpp:3415
OGRERR_UNSUPPORTED_SRS
#define OGRERR_UNSUPPORTED_SRS
Definition: ogr_core.h:299
OGRSpatialReference::SetHOMAC
OGRErr SetHOMAC(double dfCenterLat, double dfCenterLong, double dfAzimuth, double dfRectToSkew, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Set an Hotine Oblique Mercator Azimuth Center projection using azimuth angle.
Definition: ogrspatialreference.cpp:4880
SRS_PP_SCALE_FACTOR
#define SRS_PP_SCALE_FACTOR
Definition: ogr_srs_api.h:271
CPLES_SQL
#define CPLES_SQL
Definition: cpl_string.h:173
OGRSpatialReferenceH
void * OGRSpatialReferenceH
Definition: ogr_api.h:74
OGRGeomFieldDefn::GetSpatialRef
virtual OGRSpatialReference * GetSpatialRef() const
Fetch spatial reference system of this field.
Definition: ogrgeomfielddefn.cpp:435
CPLTestBool
bool CPLTestBool(const char *pszValue)
Definition: cpl_string.cpp:1526
OGRLayer::GetFeature
virtual OGRFeature * GetFeature(GIntBig nFID) CPL_WARN_UNUSED_RESULT
Fetch a feature by its identifier.
Definition: ogrlayer.cpp:446
OGRSpatialReference::SetKrovak
OGRErr SetKrovak(double dfCenterLat, double dfCenterLong, double dfAzimuth, double dfPseudoStdParallelLat, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5109
OGRField
Definition: ogr_core.h:679
OGRFeature::GetDefnRef
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition: ogr_feature.h:570
OGRFeatureDefn::GetGeomFieldDefn
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition: ogrfeaturedefn.cpp:680
OGRSpatialReference::FindProjParm
int FindProjParm(const char *pszParameter, const OGR_SRSNode *poPROJCS=nullptr) const
Return the child index of the named projection parameter on its parent PROJCS node.
Definition: ogrspatialreference.cpp:3784
OGRFeature::GetStyleString
virtual const char * GetStyleString() const
Fetch style string for this feature.
Definition: ogrfeature.cpp:6114
OGRFeatureDefn::GetFieldCount
virtual int GetFieldCount() const
Fetch number of fields on this feature.
Definition: ogrfeaturedefn.cpp:285
CPLGetDirname
const char * CPLGetDirname(const char *)
Definition: cpl_path.cpp:208
GUIntBig
unsigned long long GUIntBig
Definition: cpl_port.h:249
CPLHashSetDestroy
void CPLHashSetDestroy(CPLHashSet *set)
Definition: cpl_hash_set.cpp:207
SRS_PP_LATITUDE_OF_ORIGIN
#define SRS_PP_LATITUDE_OF_ORIGIN
Definition: ogr_srs_api.h:285
CPLE_OpenFailed
#define CPLE_OpenFailed
Definition: cpl_error.h:105
VALIDATE_POINTER1
#define VALIDATE_POINTER1(ptr, func, rc)
Definition: cpl_error.h:260
OGRERR_FAILURE
#define OGRERR_FAILURE
Definition: ogr_core.h:298
OGR_SRSNode::GetChild
OGR_SRSNode * GetChild(int)
Definition: ogr_srsnode.cpp:122
OFTString
@ OFTString
Definition: ogr_core.h:600
OAO_Other
@ OAO_Other
Definition: ogr_srs_api.h:49
OGRSpatialReference::importFromDict
OGRErr importFromDict(const char *pszDict, const char *pszCode)
Definition: ogr_srs_dict.cpp:70
OGRSpatialReference::SetTMSO
OGRErr SetTMSO(double dfCenterLat, double dfCenterLong, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:4121
OGRSpatialReference::SetGeogCS
OGRErr SetGeogCS(const char *pszGeogName, const char *pszDatumName, const char *pszEllipsoidName, double dfSemiMajor, double dfInvFlattening, const char *pszPMName=nullptr, double dfPMOffset=0.0, const char *pszUnits=nullptr, double dfConvertToRadians=0.0)
Set geographic coordinate system.
Definition: ogrspatialreference.cpp:1769
ogrsf_frmts.h
OGRSpatialReference::Clear
void Clear()
Wipe current definition.
Definition: ogrspatialreference.cpp:259
OGRSpatialReference::SetGeocCS
OGRErr SetGeocCS(const char *pszGeocName)
Set the user visible GEOCCS name.
Definition: ogrspatialreference.cpp:3308
CPLDebug
void CPLDebug(const char *, const char *,...)
Definition: cpl_error.cpp:544
OGRSpatialReference::EPSGTreatsAsLatLong
int EPSGTreatsAsLatLong() const
This method returns TRUE if EPSG feels this geographic coordinate system should be treated as having ...
Definition: ogr_fromepsg.cpp:2787
OGRLayer::GetExtent
virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce=TRUE) CPL_WARN_UNUSED_RESULT
Fetch the extent of this layer.
Definition: ogrlayer.cpp:210
OGRFieldDefn
Definition: ogr_feature.h:92
CPLFormFilename
const char * CPLFormFilename(const char *pszPath, const char *pszBasename, const char *pszExtension)
Definition: cpl_path.cpp:535
ogr_srs_api.h
OGRFeature::SetStyleString
virtual void SetStyleString(const char *)
Set feature style string.
Definition: ogrfeature.cpp:6166
OFTInteger
@ OFTInteger
Definition: ogr_core.h:596
VSIStatL
int VSIStatL(const char *, VSIStatBufL *)
Get filesystem object info.
Definition: cpl_vsil.cpp:558
OGRFeature::GetFieldAsDouble
double GetFieldAsDouble(int i) const
Fetch field value as a double.
Definition: ogrfeature.cpp:2116
STARTS_WITH
#define STARTS_WITH(a, b)
Definition: cpl_port.h:568
OLMD_FID64
#define OLMD_FID64
Definition: ogr_core.h:787
CPLMalloc
void * CPLMalloc(size_t)
Definition: cpl_conv.cpp:168
SRS_PP_STANDARD_PARALLEL_1
#define SRS_PP_STANDARD_PARALLEL_1
Definition: ogr_srs_api.h:273
SRS_PT_POLAR_STEREOGRAPHIC
#define SRS_PT_POLAR_STEREOGRAPHIC
Definition: ogr_srs_api.h:186
cpl_conv.h
wkbNone
@ wkbNone
Definition: ogr_core.h:349
CPLHashSetEqualPointer
int CPLHashSetEqualPointer(const void *elt1, const void *elt2)
Definition: cpl_hash_set.cpp:533
OGR_G_ForceToLineString
OGRGeometryH OGR_G_ForceToLineString(OGRGeometryH) CPL_WARN_UNUSED_RESULT
Convert to line string.
Definition: ogrgeometryfactory.cpp:4136
wkbPolygon
@ wkbPolygon
Definition: ogr_core.h:324
cpl_string.h
OGRSpatialReference::SetHOM
OGRErr SetHOM(double dfCenterLat, double dfCenterLong, double dfAzimuth, double dfRectToSkew, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Set a Hotine Oblique Mercator projection using azimuth angle.
Definition: ogrspatialreference.cpp:4949
OGRSpatialReference::SetAxes
OGRErr SetAxes(const char *pszTargetKey, const char *pszXAxisName, OGRAxisOrientation eXAxisOrientation, const char *pszYAxisName, OGRAxisOrientation eYAxisOrientation)
Set the axes for a coordinate system.
Definition: ogrspatialreference.cpp:8375
OGR_SRSNode::AddChild
void AddChild(OGR_SRSNode *)
Definition: ogr_srsnode.cpp:238
SRS_UL_METER
#define SRS_UL_METER
Definition: ogr_srs_api.h:336
CPLErrorReset
void CPLErrorReset(void)
Definition: cpl_error.cpp:710
CPLSPrintf
const char * CPLSPrintf(const char *fmt,...)
Definition: cpl_string.cpp:977
OGRSpatialReference::SetOS
OGRErr SetOS(double dfOriginLat, double dfCMeridian, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5488
OFSTNone
@ OFSTNone
Definition: ogr_core.h:624
OGRSpatialReference::importFromEPSG
OGRErr importFromEPSG(int)
Initialize SRS based on EPSG GCS or PCS code.
Definition: ogr_fromepsg.cpp:2137
OSRCalcInvFlattening
double OSRCalcInvFlattening(double dfSemiMajor, double dfSemiMinor)
Compute inverse flattening from semi-major and semi-minor axis.
Definition: ogrspatialreference.cpp:8574
OGRAxisOrientation
OGRAxisOrientation
Definition: ogr_srs_api.h:48
OGRSpatialReference::importFromProj4
OGRErr importFromProj4(const char *)
Import PROJ.4 coordinate string.
Definition: ogr_srs_proj4.cpp:478
CPLError
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:232
SRS_PT_LAMBERT_CONFORMAL_CONIC_1SP
#define SRS_PT_LAMBERT_CONFORMAL_CONIC_1SP
Definition: ogr_srs_api.h:155
OGRGeomFieldDefn
Definition: ogr_feature.h:182
CPLString::tolower
CPLSTRING_DLL CPLString & tolower(void)
Definition: cplstring.cpp:349
OSREPSGTreatsAsNorthingEasting
int OSREPSGTreatsAsNorthingEasting(OGRSpatialReferenceH hSRS)
This function returns TRUE if EPSG feels this geographic coordinate system should be treated as havin...
Definition: ogr_fromepsg.cpp:2887
OGRSpatialReference::SetLAEA
OGRErr SetLAEA(double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5154
VSIFree
void VSIFree(void *)
Definition: cpl_vsisimple.cpp:823
CPLE_NotSupported
#define CPLE_NotSupported
Definition: cpl_error.h:109
OGRSpatialReference::GetLinearUnits
double GetLinearUnits(char **) const CPL_WARN_DEPRECATED("Use GetLinearUnits( const char**) instead")
Fetch linear projection units.
Definition: ogrspatialreference.cpp:1463
OFTTime
@ OFTTime
Definition: ogr_core.h:606
OGRFieldDefn::GetType
OGRFieldType GetType() const
Fetch type of this field.
Definition: ogr_feature.h:115
CSLDuplicate
char ** CSLDuplicate(CSLConstList papszStrList)
Definition: cpl_string.cpp:228
OGRFeature::IsFieldSetAndNotNull
bool IsFieldSetAndNotNull(int iField) const
Test if a field is set and not null.
Definition: ogrfeature.cpp:1583
OSREPSGTreatsAsLatLong
int OSREPSGTreatsAsLatLong(OGRSpatialReferenceH hSRS)
This function returns TRUE if EPSG feels this geographic coordinate system should be treated as havin...
Definition: ogr_fromepsg.cpp:2821
OGRErr
int OGRErr
Definition: ogr_core.h:290
OGRSpatialReference::SetAuthority
OGRErr SetAuthority(const char *pszTargetKey, const char *pszAuthority, int nCode)
Set the authority for a node.
Definition: ogrspatialreference.cpp:6100
CPLString::replaceAll
CPLSTRING_DLL CPLString & replaceAll(const std::string &osBefore, const std::string &osAfter)
Definition: cplstring.cpp:366
_CPLHashSet
Definition: cpl_hash_set.cpp:40
CSLDestroy
void CSLDestroy(char **papszStrList)
Definition: cpl_string.cpp:200
M_PI
#define M_PI
Definition: cpl_port.h:407
GIntBig
long long GIntBig
Definition: cpl_port.h:246
OGRFeature::GetFieldDefnRef
const OGRFieldDefn * GetFieldDefnRef(int iField) const
Fetch definition for this field.
Definition: ogr_feature.h:601
OSRImportFromEPSGA
OGRErr CPL_STDCALL OSRImportFromEPSGA(OGRSpatialReferenceH, int)
Initialize SRS based on EPSG GCS or PCS code.
Definition: ogr_fromepsg.cpp:2356
VSI_MALLOC_VERBOSE
#define VSI_MALLOC_VERBOSE(size)
Definition: cpl_vsi.h:265
OGRwkbGeometryType
OGRwkbGeometryType
Definition: ogr_core.h:317
SRS_PP_FALSE_EASTING
#define SRS_PP_FALSE_EASTING
Definition: ogr_srs_api.h:287
OGRFeature::GetRawFieldRef
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:618
OLCRandomRead
#define OLCRandomRead
Definition: ogr_core.h:748
OFTDate
@ OFTDate
Definition: ogr_core.h:605
OGRFeature
Definition: ogr_feature.h:353
OGRSpatialReference::SetLCC
OGRErr SetLCC(double dfStdP1, double dfStdP2, double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5188
OSRAxisEnumToName
const char * OSRAxisEnumToName(OGRAxisOrientation eOrientation)
Return the string representation for the OGRAxisOrientation enumeration.
Definition: ogrspatialreference.cpp:8332
VSIStatBufL
struct stat64 VSIStatBufL
Definition: cpl_vsi.h:191
cpl_port.h
OGRGeomFieldDefn::GetType
OGRwkbGeometryType GetType() const
Fetch geometry type of this field.
Definition: ogr_feature.h:205
OGRFeature::GetNativeMediaType
const char * GetNativeMediaType() const
Returns the native media type for the feature.
Definition: ogr_feature.h:745
ogr_api.h
OGRFeature::SetGeomField
OGRErr SetGeomField(int iField, const OGRGeometry *)
Set feature geometry of a specified geometry field.
Definition: ogrfeature.cpp:880
OLCFastGetExtent
#define OLCFastGetExtent
Definition: ogr_core.h:753
OGR_SRSNode::FindChild
int FindChild(const char *) const
Definition: ogr_srsnode.cpp:322
SRS_UL_US_FOOT_CONV
#define SRS_UL_US_FOOT_CONV
Definition: ogr_srs_api.h:344
VSIFOpenL
VSILFILE * VSIFOpenL(const char *, const char *)
Open file.
Definition: cpl_vsil.cpp:818
wkbGeometryCollection
@ wkbGeometryCollection
Definition: ogr_core.h:330
OGRFieldType
OGRFieldType
Definition: ogr_core.h:594
OGRFeatureDefn::GetGeomFieldCount
virtual int GetGeomFieldCount() const
Fetch number of geometry fields on this feature.
Definition: ogrfeaturedefn.cpp:631
OGR_G_ForceToMultiPolygon
OGRGeometryH OGR_G_ForceToMultiPolygon(OGRGeometryH) CPL_WARN_UNUSED_RESULT
Convert to multipolygon.
Definition: ogrgeometryfactory.cpp:962
OGRLayer::SetNextByIndex
virtual OGRErr SetNextByIndex(GIntBig nIndex)
Move read cursor to the nIndex'th feature in the current resultset.
Definition: ogrlayer.cpp:498
OGRSpatialReference::GetAttrNode
OGR_SRSNode * GetAttrNode(const char *)
Find named node in tree.
Definition: ogrspatialreference.cpp:465
OGRLayer::SetIgnoredFields
virtual OGRErr SetIgnoredFields(const char **papszFields)
Set which fields can be omitted when retrieving features from the layer.
Definition: ogrlayer.cpp:1791
OGR_SRSNode::Clone
OGR_SRSNode * Clone() const
Definition: ogr_srsnode.cpp:375
CSLAddString
char ** CSLAddString(char **papszStrList, const char *pszNewString)
Definition: cpl_string.cpp:83
OGRSpatialReference::SetCS
OGRErr SetCS(double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:4376
OGRSpatialReference::OGRSpatialReference
OGRSpatialReference(const OGRSpatialReference &)
Definition: ogrspatialreference.cpp:175
OFTInteger64
@ OFTInteger64
Definition: ogr_core.h:608
OGRFeature::GetFieldAsInteger64
GIntBig GetFieldAsInteger64(int i) const
Fetch field value as integer 64 bit.
Definition: ogrfeature.cpp:1998
OGRFeature::GetFieldAsInteger
int GetFieldAsInteger(int i) const
Fetch field value as integer.
Definition: ogrfeature.cpp:1859
OGRERR_NONE
#define OGRERR_NONE
Definition: ogr_core.h:292
CPLStrdup
char * CPLStrdup(const char *)
Definition: cpl_conv.cpp:293
OGRFeatureDefn
Definition: ogr_feature.h:259
CPLAtof
double CPLAtof(const char *)
Definition: cpl_strtod.cpp:117
OGR_SRSNode
Definition: ogr_spatialref.h:65
OGRLayer::SetAttributeFilter
virtual OGRErr SetAttributeFilter(const char *)
Set a new attribute query.
Definition: ogrlayer.cpp:337
OLCFastSetNextByIndex
#define OLCFastSetNextByIndex
Definition: ogr_core.h:760
wkbLineString
@ wkbLineString
Definition: ogr_core.h:322
OGRFeature::GetGeomFieldRef
OGRGeometry * GetGeomFieldRef(int iField)
Fetch pointer to feature geometry.
Definition: ogrfeature.cpp:666
OGRSpatialReference::importFromEPSGA
OGRErr importFromEPSGA(int)
Initialize SRS based on EPSG GCS or PCS code.
Definition: ogr_fromepsg.cpp:2202
wkbMultiLineString
@ wkbMultiLineString
Definition: ogr_core.h:328
CPLGetHomeDir
const char * CPLGetHomeDir(void)
Definition: cpl_path.cpp:1166
OSRSetStatePlaneWithUnits
OGRErr OSRSetStatePlaneWithUnits(OGRSpatialReferenceH hSRS, int nZone, int bNAD83, const char *pszOverrideUnitName, double dfOverrideUnit)
Set State Plane projection definition.
Definition: ogr_fromepsg.cpp:2519
OGRSpatialReference::SetTM
OGRErr SetTM(double dfCenterLat, double dfCenterLong, double dfScale, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:4039
OGRLayer::TestCapability
virtual int TestCapability(const char *)=0
Test if this layer supported the named capability.
OGRSpatialReference::exportToWkt
OGRErr exportToWkt(char **) const
Convert this SRS into WKT format.
Definition: ogrspatialreference.cpp:728
CPLQuietErrorHandler
void CPLQuietErrorHandler(CPLErr, CPLErrorNum, const char *)
Definition: cpl_error.cpp:948
OGRSpatialReference::AutoIdentifyEPSG
OGRErr AutoIdentifyEPSG()
Set EPSG authority info if possible.
Definition: ogr_fromepsg.cpp:2642
SRS_PP_FALSE_NORTHING
#define SRS_PP_FALSE_NORTHING
Definition: ogr_srs_api.h:289
OGRSpatialReference::SetCEA
OGRErr SetCEA(double dfStdP1, double dfCentralMeridian, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:4342
OFTReal
@ OFTReal
Definition: ogr_core.h:598
OGRSpatialReference::SetLocalCS
OGRErr SetLocalCS(const char *)
Set the user visible LOCAL_CS name.
Definition: ogrspatialreference.cpp:3252
ogr_core.h
OGRFieldDefn::GetSubType
OGRFieldSubType GetSubType() const
Fetch subtype of this field.
Definition: ogr_feature.h:119
OGRSpatialReference::SetNZMG
OGRErr SetNZMG(double dfCenterLat, double dfCenterLong, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5454
OGRSpatialReference::GetProjParm
double GetProjParm(const char *, double=0.0, OGRErr *=nullptr) const
Fetch a projection parameter value.
Definition: ogrspatialreference.cpp:3851
OSRSetStatePlane
OGRErr OSRSetStatePlane(OGRSpatialReferenceH hSRS, int nZone, int bNAD83)
Set State Plane projection definition.
Definition: ogr_fromepsg.cpp:2500
OGRSpatialReference::IsGeographic
int IsGeographic() const
Check if geographic coordinate system.
Definition: ogrspatialreference.cpp:6542
CPLFree
#define CPLFree
Definition: cpl_conv.h:81
wkbUnknown
@ wkbUnknown
Definition: ogr_core.h:319
OSRImportFromEPSG
OGRErr CPL_STDCALL OSRImportFromEPSG(OGRSpatialReferenceH, int)
Initialize SRS based on EPSG GCS or PCS code.
Definition: ogr_fromepsg.cpp:2168
OGRSpatialReference::SetSOC
OGRErr SetSOC(double dfLatitudeOfOrigin, double dfCentralMeridian, double dfFalseEasting, double dfFalseNorthing)
Definition: ogrspatialreference.cpp:5746
OGRSpatialReference::SetNormProjParm
OGRErr SetNormProjParm(const char *, double)
Set a projection parameter with a normalized value.
Definition: ogrspatialreference.cpp:3994
OGRFeature::GetNativeData
const char * GetNativeData() const
Returns the native data for the feature.
Definition: ogr_feature.h:744
CPLHashSetLookup
void * CPLHashSetLookup(CPLHashSet *set, const void *elt)
Definition: cpl_hash_set.cpp:405
OGRFeature::GetFID
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:711
VSIFPrintfL
int VSIFPrintfL(VSILFILE *, const char *,...) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Formatted write to file.
Definition: cpl_vsil.cpp:1374
CPLGetConfigOption
const char * CPLGetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1690
VSILFILE
FILE VSILFILE
Definition: cpl_vsi.h:155
OGR_G_ForceToPolygon
OGRGeometryH OGR_G_ForceToPolygon(OGRGeometryH) CPL_WARN_UNUSED_RESULT
Convert to polygon.
Definition: ogrgeometryfactory.cpp:792
OGRGeometry::ToHandle
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Definition: ogr_geometry.h:510
OGR_SRSNode::StripNodes
void StripNodes(const char *)
Definition: ogr_srsnode.cpp:891
CPLE_AppDefined
#define CPLE_AppDefined
Definition: cpl_error.h:99
SRS_UL_US_FOOT
#define SRS_UL_US_FOOT
Definition: ogr_srs_api.h:342
OGRSpatialReference::SetFromUserInput
OGRErr SetFromUserInput(const char *)
Set spatial reference from various text formats.
Definition: ogrspatialreference.cpp:2205

Generated for GDAL by doxygen 1.8.17.