19#ifndef _TM_GISDATAVECTOR_SHP_H_
20#define _TM_GISDATAVECTOR_SHP_H_
33#include "ogrsf_frmts.h"
34#include "tmgisdatavector.h"
38 GDALDataset* m_Datasource;
40 GDALDataset* m_RasterizeDataset;
41 OGRFeature* m_Feature;
43 int m_MultiFeaturesIterator;
44 int m_MultiFeaturesOid;
52 virtual bool Open(
const wxString& filename,
bool bReadWrite = FALSE);
56 virtual tmRealRect GetMinimalBoundingRectangle();
58 virtual TM_GIS_SPATIAL_TYPES GetSpatialType();
61 virtual bool SetSpatialFilter(
tmRealRect filter,
int type);
63 virtual bool SetAttributeFilter(
const wxString& query);
65 virtual wxRealPoint* GetNextDataLine(
int& nbvertex,
long& oid,
bool& isOver);
67 virtual wxRealPoint* GetNextDataPoint(
long& oid,
bool& isOver);
69 virtual int GetNextDataPolygonInfo(
long& oid);
71 virtual wxRealPoint* GetNextDataPolygon(
int currentring,
int& nbvertex);
75 virtual OGRFeature* GetNextFeature();
77 virtual bool ResetReading();
79 virtual OGRFeature* GetFeatureByOID(
long oid);
81 bool SelectFeatureByOID(
long oid);
83 virtual OGRGeometry* GetNextGeometry(
bool restart,
long& oid);
85 OGRLayer* GetLayerRef() {
100 virtual bool GetFieldsName(wxArrayString& Fields,
long oid = wxNOT_FOUND);
102 virtual bool GetFieldsValue(wxArrayString& values,
long oid);
104 bool GetDistinctFieldsValue(
const wxString& fieldname, wxArrayString& values);
111 virtual bool GetSnapCoord(
const wxRealPoint& clickpt,
double buffersize, wxArrayRealPoints& snapppts,
int snaptype);
114 virtual bool CreateFile(
const wxFileName& filename,
int type);
116 virtual bool AddFieldText(
const wxString& fieldname,
int size);
118 virtual bool AddFieldNumeric(
const wxString& fieldname,
bool isfloat =
false);
122 virtual long AddGeometry(OGRGeometry* Geom,
const long& oid,
int layertype = wxNOT_FOUND);
126 virtual bool SetFieldValue(
const wxString& value,
int fieldtype,
int iindex);
134 virtual void CloseGeometry();
136 virtual bool GetFieldNumeric(
const wxString& fieldname,
int& fieldvalue);
138 virtual bool SetFieldNumeric(
const wxString& fieldname,
int fieldvalue);
141 bool ExecuteSQLQuery(
const wxString& query);
143 long GetFeatureIDIntersectedBy(OGRGeometry* geometry);
145 long GetFeatureIDIntersectedOnRaster(OGRPoint* geometry);
147 bool Rasterize(
double rasterizefactor);
149 void RemoveRasterizeFile();
151 virtual bool DeleteFile(
const wxString& layername);
153 virtual bool CreateSpatialIndex(GDALProgressFunc progress,
void* pfProgressData);
155 virtual bool CopyToFile(
const wxFileName& filename,
const wxString& drivername,
bool overwrite);
165 virtual bool CreateFile(
const wxFileName& filename,
int type);
Definition tmgisdatavectorshp.h:158
virtual bool CreateFile(const wxFileName &filename, int type)
Create the shp on the disk.
Definition tmgisdatavectorshp.cpp:1447
Definition tmgisdatavectorshp.h:36
virtual long GetActualOID()
Return the actual OID.
Definition tmgisdatavectorshp.cpp:979
virtual bool CreateFile(const wxFileName &filename, int type)
Create the shp on the disk.
Definition tmgisdatavectorshp.cpp:777
virtual wxArrayLong * GetAllData()
Get OID of all features back from the shapefile.
Definition tmgisdatavectorshp.cpp:752
virtual int GetCount()
Counting features in layer.
Definition tmgisdatavectorshp.cpp:544
virtual bool GetFieldsName(wxArrayString &Fields, long oid=wxNOT_FOUND)
Getting fields name.
Definition tmgisdatavectorshp.cpp:634
virtual long AddGeometry(OGRGeometry *Geom, const long &oid, int layertype=wxNOT_FOUND)
Add a geometry in the shapefile.
Definition tmgisdatavectorshp.cpp:924
virtual wxArrayLong * SearchData(const tmRealRect &rect, int type)
Search spatial data.
Definition tmgisdatavectorshp.cpp:716
virtual bool AddFieldNumeric(const wxString &fieldname, bool isfloat=false)
Add int field to the Shp.
Definition tmgisdatavectorshp.cpp:874
virtual bool SetFieldValue(const wxString &value, int fieldtype, int iindex)
Add value into a field.
Definition tmgisdatavectorshp.cpp:1013
virtual void SetActualOID(long oid)
Set the OID for the current Feature.
Definition tmgisdatavectorshp.cpp:997
virtual bool SetNextFeature(bool resetreading=false)
Move to next feature.
Definition tmgisdatavectorshp.cpp:957
virtual OGRPolygon * GetNextDataOGRPolygon(long &oid)
Get the actual feature as polygon.
Definition tmgisdatavectorshp.cpp:527
virtual bool AddFieldDate(const wxString &fieldname)
Add date field to the Shp.
Definition tmgisdatavectorshp.cpp:899
virtual wxString GetMetaDataAsHtml()
Get Metadata information well formated.
Definition tmgisdatavectorshp.cpp:561
virtual int GetFieldsCount()
Get the number of fields.
Definition tmgisdatavectorshp.cpp:620
virtual bool UpdateFeature()
Update the actual feature.
Definition tmgisdatavectorshp.cpp:1080
virtual bool AddFieldText(const wxString &fieldname, int size)
Add text fields to the Shp.
Definition tmgisdatavectorshp.cpp:848
virtual bool GetSnapCoord(const wxRealPoint &clickpt, double buffersize, wxArrayRealPoints &snapppts, int snaptype)
Get snapping coordinate.
Definition tmgisdatavectorshp.cpp:1137
virtual wxString GetDataSizeAsHtml(int iPrecision=2)
Getting Data size.
Definition tmgisdatavectorshp.cpp:587
virtual bool Open(const wxString &filename, bool bReadWrite=FALSE)
Generic open code.
Definition tmgisdatavectorshp.cpp:48
Definition tmgisdatavector.h:48
Class representing real rectangle.
Definition tmgisscale.h:44