1
/***************************************************************************
2
qgsoverlayanalyzer.h - QGIS Tools for vector geometry analysis
5
copyright : (C) Carson Farmer
6
email : carson.farmer@gmail.com
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
17
/* $Id: qgis.h 9774 2008-12-12 05:41:24Z timlinux $ */
19
#ifndef QGSOVERLAYANALYZERH
20
#define QGSOVERLAYANALYZERH
22
#include "qgsvectorlayer.h"
24
#include "qgsspatialindex.h"
25
#include "qgsfeature.h"
26
#include "qgsgeometry.h"
28
#include "qgsdistancearea.h"
30
class QgsVectorFileWriter;
31
class QProgressDialog;
35
* The QGis class provides vector overlay analysis functions
38
class ANALYSIS_EXPORT QgsOverlayAnalyzer
42
/**Perform an intersection on two input vector layers and write output to a new shape file
43
@param layerA input vector layer
44
@param layerB input vector layer
45
@param shapefileName path to the output shp
46
@param onlySelectedFeatures if true, only selected features are considered, else all the features
47
@param p progress dialog (or 0 if no progress dialog is to be shown)
48
@note: added in version 1.4*/
49
bool intersection( QgsVectorLayer* layerA, QgsVectorLayer* layerB, \
50
const QString& shapefileName, bool onlySelectedFeatures = false, \
51
QProgressDialog* p = 0 );
53
// /**Perform a union of two input vector layers and write output to a new shape file
54
// @param layerA input vector layer
55
// @param layerB input vector layer
56
// @param shapefileName path to the output shp
57
// @param onlySelectedFeatures if true, only selected features are considered, else all the features
58
// @param p progress dialog (or 0 if no progress dialog is to be shown)
59
// @note: added in version 1.4*/
60
// bool combine( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
61
// const QString& shapefileName, bool onlySelectedFeatures = false,
62
// QProgressDialog* p = 0 );
64
// /**Clip a vector layer based on the boundary of another vector layer and
65
// write output to a new shape file
66
// @param layerA input vector layer
67
// @param layerB input vector layer
68
// @param shapefileName path to the output shp
69
// @param onlySelectedFeatures if true, only selected features are considered, else all the features
70
// @param p progress dialog (or 0 if no progress dialog is to be shown)
71
// @note: added in version 1.4*/
72
// bool clip( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
73
// const QString& shapefileName, bool onlySelectedFeatures = false,
74
// QProgressDialog* p = 0 );
76
// /**Difference a vector layer based on the geometries of another vector layer
77
// and write the output to a new shape file
78
// @param layerA input vector layer
79
// @param layerB input vector layer
80
// @param shapefileName path to the output shp
81
// @param onlySelectedFeatures if true, only selected features are considered, else all the features
82
// @param p progress dialog (or 0 if no progress dialog is to be shown)
83
// @note: added in version 1.4*/
84
// bool difference( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
85
// const QString& shapefileName, bool onlySelectedFeatures = false,
86
// QProgressDialog* p = 0 );
88
// /**Intersect two vector layers and write the geometries of each layer that
89
// do not intersect with the other layer to a new shape file (Symmetrical difference)
90
// @param layerA input vector layer
91
// @param layerB input vector layer
92
// @param shapefileName path to the output shp
93
// @param onlySelectedFeatures if true, only selected features are considered, else all the features
94
// @param p progress dialog (or 0 if no progress dialog is to be shown)
95
// @note: added in version 1.4*/
96
// bool symDifference( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
97
// const QString& shapefileName, bool onlySelectedFeatures = false,
98
// QProgressDialog* p = 0 );
102
void combineFieldLists( QgsFieldMap& fieldListA, QgsFieldMap fieldListB );
103
void intersectFeature( QgsFeature& f, QgsVectorFileWriter* vfw, QgsVectorLayer* dp, QgsSpatialIndex* index );
104
void combineAttributeMaps( QgsAttributeMap& attributeMapA, QgsAttributeMap attributeMapB );
106
#endif //QGSVECTORANALYZER