~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to src/analysis/vector/qgsoverlayanalyzer.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    qgsoverlayanalyzer.h - QGIS Tools for vector geometry analysis
 
3
                             -------------------
 
4
    begin                : 19 March 2009
 
5
    copyright            : (C) Carson Farmer
 
6
    email                : carson.farmer@gmail.com
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
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.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
/* $Id: qgis.h 9774 2008-12-12 05:41:24Z timlinux $ */
 
18
 
 
19
#ifndef QGSOVERLAYANALYZERH
 
20
#define QGSOVERLAYANALYZERH
 
21
 
 
22
#include "qgsvectorlayer.h"
 
23
#include "qgsfield.h"
 
24
#include "qgsspatialindex.h"
 
25
#include "qgsfeature.h"
 
26
#include "qgsgeometry.h"
 
27
#include "qgsfield.h"
 
28
#include "qgsdistancearea.h"
 
29
 
 
30
class QgsVectorFileWriter;
 
31
class QProgressDialog;
 
32
 
 
33
 
 
34
/** \ingroup analysis
 
35
 * The QGis class provides vector overlay analysis functions
 
36
 */
 
37
 
 
38
class ANALYSIS_EXPORT QgsOverlayAnalyzer
 
39
{
 
40
  public:
 
41
 
 
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 );
 
52
 
 
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 );
 
63
//
 
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 );
 
75
//
 
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 );
 
87
//
 
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 );
 
99
 
 
100
  private:
 
101
 
 
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 );
 
105
};
 
106
#endif //QGSVECTORANALYZER