ToolMap
Loading...
Searching...
No Matches
tmexportdatashp.h
1/***************************************************************************
2 tmexportdatashp.h
3 Class for the process of exporting data as SHP
4 -------------------
5 copyright : (C) 2007 CREALP Lucien Schreiber
6 ***************************************************************************/
7
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17// comment doxygen
18
19#ifndef _TM_EXPORTDATA_SHP_H_
20#define _TM_EXPORTDATA_SHP_H_
21
22// For compilers that support precompilation, includes "wx/wx.h".
23#include <wx/wxprec.h>
24
25// Include wxWidgets' headers
26#ifndef WX_PRECOMP
27#include <wx/wx.h>
28#endif
29
30#include "../gis/tmgisdatavectorshp.h" // for shp
31#include "tmexportdata.h" // for parent class definition
32
34 private:
35 tmGISDataVectorSHP* m_Shp;
36 OGRPolygon* m_Frame;
37
38 // private function
39 void InitMemberValues();
40
41 int m_ExportPolyNbIteration;
42 double m_ExportPolyRasterFactor;
43 double m_ExportPolyPercentSkipped;
44 bool m_ExportPolyFast;
45
46 // for windows bug
47 OGRGeometry* SafeIntersection(OGRGeometry* line, OGRGeometry* frame);
48
49 OGRGeometry* SafeUnion(OGRGeometry* union1, OGRGeometry* line);
50
51 OGRGeometry* SafeCreateFromGEOS(GEOSGeom geosGeom);
52
53 OGRGeometry* SafeBuffer(OGRGeometry* ogrgeom, double size);
54
55 // multiple fields
56 bool SetMultipleFields(ProjectDefMemoryLayers* layer, const wxArrayString& values);
57
58 void _AppendValidToCollection(OGRGeometry* geometry, OGRGeometryCollection* collection);
59
60 virtual bool SetPolyExportInfo(ProjectDefMemoryLayers* layer);
61
62 protected:
63 public:
64 // ctor
66
67 tmExportDataSHP(DataBaseTM* database);
68
69 void Create(DataBaseTM* database);
70
72
73 // create export file
74 virtual bool CreateEmptyExportFile(ProjectDefMemoryLayers* myLayer, const wxString& path);
75
76 virtual bool CreatePrjFile(ProjectDefMemoryLayers* myLayer, const wxString& path, PRJDEF_PROJ_TYPE proj);
77
78 virtual bool AddOptFields(const PrjMemFieldArray& myfields);
79
80 virtual bool AddGenericFields(int iSize);
81
82 virtual bool AddFIDField();
83
84 // frame function
85 virtual void SetFrame(wxRealPoint* points, int nbvertex);
86
87 // writing functions
88 virtual bool WriteLines(ProjectDefMemoryLayers* myLayer);
89
90 virtual bool WritePoints(ProjectDefMemoryLayers* myLayer);
91
92 virtual bool WritePolygons(ProjectDefMemoryLayers* myLayer);
93
94 virtual bool WriteLabels(ProjectDefMemoryLayers* myLayer);
95
96 virtual long WriteConcatGeometries(ProjectDefMemoryLayers* layer, wxProgressDialog* progDlg, tmPercent* percent);
97
98 virtual bool AddConcatAttributs(ProjectDefMemoryLayers* layer, PrjDefMemManage* projdef, long loop,
99 wxProgressDialog* progDlg, tmPercent* percent);
100
101 virtual bool SetAttributsBasic(DataBaseResult& results);
102
103 virtual bool SetAttributsAdvanced(DataBaseResult& results, ProjectDefMemoryLayers* layer);
104
105 virtual bool GetPolyExportInfo(ProjectDefMemoryLayers* layer, bool usefastexport);
106
107 virtual bool CreateSpatialIndex(ProjectDefMemoryLayers* layer);
108
109 virtual bool HasFeatures();
110
111 virtual bool DeleteLayer(ProjectDefMemoryLayers* layer, const wxString& path);
112};
113
114#endif
Definition databaseresult.h:30
Definition database_tm.h:80
Definition prjdefmemmanage.h:54
Storing layers properties in memory.
Definition projectdefmemory.h:246
Definition tmexportdatashp.h:33
virtual bool WriteLines(ProjectDefMemoryLayers *myLayer)
Write all geometrics lines to the shp.
Definition tmexportdatashp.cpp:237
virtual bool AddFIDField()
Adding Field for storing ToolMap FID.
Definition tmexportdatashp.cpp:220
tmExportDataSHP()
Constructor.
Definition tmexportdatashp.cpp:46
virtual bool WritePoints(ProjectDefMemoryLayers *myLayer)
Write all geometrics points to the shp.
Definition tmexportdatashp.cpp:526
virtual bool AddGenericFields(int iSize)
Adding generic fields.
Definition tmexportdatashp.cpp:201
virtual void SetFrame(wxRealPoint *points, int nbvertex)
Set the frame.
Definition tmexportdatashp.cpp:1101
virtual bool AddOptFields(const PrjMemFieldArray &myfields)
Add optional fields to the Shp.
Definition tmexportdatashp.cpp:151
virtual bool CreateEmptyExportFile(ProjectDefMemoryLayers *myLayer, const wxString &path)
Create empty file.
Definition tmexportdatashp.cpp:94
void Create(DataBaseTM *database)
Creator.
Definition tmexportdatashp.cpp:68
virtual bool WritePolygons(ProjectDefMemoryLayers *myLayer)
Compute polygons from lines.
Definition tmexportdatashp.cpp:762
~tmExportDataSHP()
destructor
Definition tmexportdatashp.cpp:77
Parent class for exporting data.
Definition tmexportdata.h:48
Definition tmgisdatavectorshp.h:36
Definition tmpercent.h:36