?? mitab.h
字號:
char *m_pszFname; TABAccess m_eAccessMode; char **m_papszTABFile; char *m_pszVersion; char *m_pszCharset; char **m_papszTABFnames; TABFile **m_papoTABFiles; int m_numTABFiles; int m_nMainTableIndex; // The main table is the one that also // contains the geometries char **m_papszFieldNames; char **m_papszWhereClause; TABRelation *m_poRelation; GBool m_bRelFieldsCreated; /////////////// // Private Read access specific stuff // int ParseTABFile(const char *pszDatasetPath, GBool bTestOpenNoError = FALSE); int OpenForRead(const char *pszFname, GBool bTestOpenNoError = FALSE ); /////////////// // Private Write access specific stuff // int OpenForWrite(const char *pszFname ); int WriteTABFile(); public: TABView(); virtual ~TABView(); virtual TABFileClass GetFileClass() {return TABFC_TABView;} virtual int Open(const char *pszFname, const char *pszAccess, GBool bTestOpenNoError = FALSE ); virtual int Close(); virtual const char *GetTableName() {return m_poRelation?m_poRelation->GetFeatureDefn()->GetName():"";}; virtual void ResetReading(); virtual int TestCapability( const char * pszCap ); virtual int GetFeatureCount (int bForce); virtual int GetExtent(OGREnvelope *psExtent, int bForce); /////////////// // Read access specific stuff // virtual int GetNextFeatureId(int nPrevId); virtual TABFeature *GetFeatureRef(int nFeatureId); virtual OGRFeatureDefn *GetLayerDefn(); virtual TABFieldType GetNativeFieldType(int nFieldId); virtual int GetBounds(double &dXMin, double &dYMin, double &dXMax, double &dYMax, GBool bForce = TRUE ); virtual OGRSpatialReference *GetSpatialRef(); virtual int GetFeatureCountByType(int &numPoints, int &numLines, int &numRegions, int &numTexts, GBool bForce = TRUE); virtual GBool IsFieldIndexed(int nFieldId); virtual GBool IsFieldUnique(int nFieldId); /////////////// // Write access specific stuff // virtual int SetBounds(double dXMin, double dYMin, double dXMax, double dYMax); virtual int SetFeatureDefn(OGRFeatureDefn *poFeatureDefn, TABFieldType *paeMapInfoNativeFieldTypes=NULL); virtual int AddFieldNative(const char *pszName, TABFieldType eMapInfoType, int nWidth=0, int nPrecision=0, GBool bIndexed=FALSE, GBool bUnique=FALSE); virtual int SetSpatialRef(OGRSpatialReference *poSpatialRef); virtual int SetFeature(TABFeature *poFeature, int nFeatureId = -1); virtual int SetFieldIndexed(int nFieldId); /////////////// // semi-private. virtual int GetProjInfo(TABProjInfo *poPI) { return m_nMainTableIndex!=-1? m_papoTABFiles[m_nMainTableIndex]->GetProjInfo(poPI):-1; } virtual int SetProjInfo(TABProjInfo *poPI) { return m_nMainTableIndex!=-1? m_papoTABFiles[m_nMainTableIndex]->SetProjInfo(poPI):-1; } virtual int SetMIFCoordSys(const char * /*pszMIFCoordSys*/) {return -1;};#ifdef DEBUG virtual void Dump(FILE *fpOut = NULL);#endif};/*--------------------------------------------------------------------- * class TABSeamless * * TABSeamless is used to handle seamless .TAB files that are * composed of a main .TAB file in which each feature is the MBR of * a base table. * * TABSeamless are supported for read access only. *--------------------------------------------------------------------*/class TABSeamless: public IMapInfoFile{ private: char *m_pszFname; char *m_pszPath; TABAccess m_eAccessMode; OGRFeatureDefn *m_poFeatureDefnRef; TABFile *m_poIndexTable; int m_nTableNameField; int m_nCurBaseTableId; TABFile *m_poCurBaseTable; GBool m_bEOF; /////////////// // Private Read access specific stuff // int OpenForRead(const char *pszFname, GBool bTestOpenNoError = FALSE ); int OpenBaseTable(TABFeature *poIndexFeature, GBool bTestOpenNoError = FALSE); int OpenBaseTable(int nTableId, GBool bTestOpenNoError = FALSE); int OpenNextBaseTable(GBool bTestOpenNoError =FALSE); int EncodeFeatureId(int nTableId, int nBaseFeatureId); int ExtractBaseTableId(int nEncodedFeatureId); int ExtractBaseFeatureId(int nEncodedFeatureId); public: TABSeamless(); virtual ~TABSeamless(); virtual TABFileClass GetFileClass() {return TABFC_TABSeamless;} virtual int Open(const char *pszFname, const char *pszAccess, GBool bTestOpenNoError = FALSE ); virtual int Close(); virtual const char *GetTableName() {return m_poFeatureDefnRef?m_poFeatureDefnRef->GetName():"";}; virtual void SetSpatialFilter( OGRGeometry * ); virtual void ResetReading(); virtual int TestCapability( const char * pszCap ); virtual int GetFeatureCount (int bForce); virtual int GetExtent(OGREnvelope *psExtent, int bForce); /////////////// // Read access specific stuff // virtual int GetNextFeatureId(int nPrevId); virtual TABFeature *GetFeatureRef(int nFeatureId); virtual OGRFeatureDefn *GetLayerDefn(); virtual TABFieldType GetNativeFieldType(int nFieldId); virtual int GetBounds(double &dXMin, double &dYMin, double &dXMax, double &dYMax, GBool bForce = TRUE ); virtual OGRSpatialReference *GetSpatialRef(); virtual int GetFeatureCountByType(int &numPoints, int &numLines, int &numRegions, int &numTexts, GBool bForce = TRUE); virtual GBool IsFieldIndexed(int nFieldId); virtual GBool IsFieldUnique(int nFieldId); /////////////// // Write access specific stuff // virtual int SetBounds(double dXMin, double dYMin, double dXMax, double dYMax) {return -1;} virtual int SetFeatureDefn(OGRFeatureDefn *poFeatureDefn, TABFieldType *paeMapInfoNativeFieldTypes=NULL) {return -1;} virtual int AddFieldNative(const char *pszName, TABFieldType eMapInfoType, int nWidth=0, int nPrecision=0, GBool bIndexed=FALSE, GBool bUnique=FALSE) {return -1;} virtual int SetSpatialRef(OGRSpatialReference *poSpatialRef) {return -1;} virtual int SetFeature(TABFeature *poFeature, int nFeatureId = -1) {return -1;} virtual int SetFieldIndexed(int nFieldId) {return -1;} /////////////// // semi-private. virtual int GetProjInfo(TABProjInfo *poPI) { return m_poIndexTable?m_poIndexTable->GetProjInfo(poPI):-1; } virtual int SetProjInfo(TABProjInfo *poPI) { return -1; } virtual int SetMIFCoordSys(const char * /*pszMIFCoordSys*/) {return -1;};#ifdef DEBUG virtual void Dump(FILE *fpOut = NULL);#endif};/*--------------------------------------------------------------------- * class MIFFile * * The main class for (MID/MIF) datasets. External programs should use this * class to open a (MID/MIF) dataset and read/write features from/to it. * *--------------------------------------------------------------------*/class MIFFile: public IMapInfoFile{ private: char *m_pszFname; TABAccess m_eAccessMode; char *m_pszVersion; char *m_pszCharset; char *m_pszDelimiter; char *m_pszUnique; char *m_pszIndex; char *m_pszCoordSys; TABFieldType *m_paeFieldType; GBool *m_pabFieldIndexed; GBool *m_pabFieldUnique; double m_dfXMultiplier; double m_dfYMultiplier; double m_dfXDisplacement; double m_dfYDisplacement; /* these are the projection bounds, possibly much broader than extents */ double m_dXMin; double m_dYMin; double m_dXMax; double m_dYMax; /* extents, as cached by MIFFile::PreParseFile() */ int m_bExtentsSet; OGREnvelope m_sExtents; int m_nPoints; int m_nLines; int m_nRegions; int m_nTexts; int m_nPreloadedId; // preloaded mif line is for this feature id MIDDATAFile *m_poMIDFile; // Mid file MIDDATAFile *m_poMIFFile; // Mif File OGRFeatureDefn *m_poDefn; OGRSpatialReference *m_poSpatialRef; int m_nFeatureCount; int m_nWriteFeatureId; int m_nAttribut; /////////////// // Private Read access specific stuff // int ReadFeatureDefn(); int ParseMIFHeader(); void PreParseFile(); int AddFields(const char *pszLine); int GotoFeature(int nFeatureId); int NextFeature(); /////////////// // Private Write access specific stuff // GBool m_bPreParsed; GBool m_bHeaderWrote; int WriteMIFHeader(); void UpdateExtents(double dfX,double dfY); public: MIFFile(); virtual ~MIFFile(); virtual TABFileClass GetFileClass() {return TABFC_MIFFile;} virtual int Open(const char *pszFname, const char *pszAccess, GBool bTestOpenNoError = FALSE ); virtual int Close(); virtual const char *GetTableName() {return m_poDefn?m_poDefn->GetName():"";}; virtual int TestCapability( const char * pszCap ) ; virtual int GetFeatureCount (int bForce); virtual void ResetReading(); virtual int GetExtent(OGREnvelope *psExtent, int bForce); /////////////// // Read access specific stuff // virtual int GetNextFeatureId(int nPrevId); virtual TABFeature *GetFeatureRef(int nFeatureId); virtual OGRFeatureDefn *GetLayerDefn(); virtual TABFieldType GetNativeFieldType(int nFieldId); virtual int GetBounds(double &dXMin, double &dYMin, double &dXMax, double &dYMax, GBool bForce = TRUE ); virtual OGRSpatialReference *GetSpatialRef(); virtual int GetFeatureCountByType(int &numPoints, int &numLines, int &numRegions, int &numTexts, GBool bForce = TRUE); virtual GBool IsFieldIndexed(int nFieldId); virtual GBool IsFieldUnique(int nFieldId); /////////////// // Write access specific stuff // virtual int SetBounds(double dXMin, double dYMin, double dXMax, double dYMax); virtual int SetFeatureDefn(OGRFeatureDefn *poFeatureDefn, TABFieldType *paeMapInfoNativeFieldTypes = NULL); virtual int AddFieldNative(const char *pszName, TABFieldType eMapInfoType, int nWidth=0, int nPrecision=0, GBool bIndexed=FALSE, GBool bUnique=FALSE); /* TODO */ virtual int SetSpatialRef(OGRSpatialReference *poSpatialRef); virtual int SetFeature(TABFeature *poFeature, int nFeatureId = -1); virtual int SetFieldIndexed(int nFieldId); /////////////// // semi-private. virtual int GetProjInfo(TABProjInfo * /*poPI*/){return -1;} /* { return m_poMAPFile->GetHeaderBlock()->GetProjInfo( poPI ); }*/ virtual int SetProjInfo(TABProjInfo * /*poPI*/){return -1;} /* { return m_poMAPFile->GetHeaderBlock()->SetProjInfo( poPI ); }*/ virtual int SetMIFCoordSys(const char * pszMIFCoordSys);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -