QGIS API Documentation  2.11.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qgstransectsample.h
Go to the documentation of this file.
1 #ifndef QGSTRANSECTSAMPLE_H
2 #define QGSTRANSECTSAMPLE_H
3 
4 #include "qgsfeature.h"
5 #include <QMap>
6 #include <QString>
7 
8 class QgsDistanceArea;
9 class QgsGeometry;
10 class QgsSpatialIndex;
11 class QgsVectorLayer;
12 class QgsPoint;
13 class QProgressDialog;
14 
16 class ANALYSIS_EXPORT QgsTransectSample
17 {
18  public:
19 
21  {
23  StrataUnits //units are the same as stratum layer
24  };
25 
26  QgsTransectSample( QgsVectorLayer* strataLayer, QString strataIdAttribute, QString minDistanceAttribute, QString nPointsAttribute,
27  DistanceUnits minDistUnits, QgsVectorLayer* baselineLayer, bool shareBaseline,
28  QString baselineStrataId, const QString& outputPointLayer, const QString& outputLineLayer, const QString& usedBaselineLayer, double minTransectLength = 0.0,
29  double baselineBufferDistance = -1.0, double baselineSimplificationTolerance = -1.0 );
31 
32  int createSample( QProgressDialog* pd );
33 
34  private:
35  QgsTransectSample(); //default constructor forbidden
36 
37  QgsGeometry* findBaselineGeometry( QVariant strataId );
38 
40  static bool otherTransectWithinDistance( QgsGeometry* geom, double minDistLayerUnit, double minDistance, QgsSpatialIndex& sIndex, const QMap< QgsFeatureId, QgsGeometry* >&
41  lineFeatureMap, QgsDistanceArea& da );
42 
43  QgsVectorLayer* mStrataLayer;
44  QString mStrataIdAttribute;
45  QString mMinDistanceAttribute;
46  QString mNPointsAttribute;
47 
48  QgsVectorLayer* mBaselineLayer;
49  bool mShareBaseline;
50  QString mBaselineStrataId;
51 
52  QString mOutputPointLayer;
53  QString mOutputLineLayer;
54  QString mUsedBaselineLayer;
55 
56  DistanceUnits mMinDistanceUnits;
57 
58  double mMinTransectLength;
59 
61  double mBaselineBufferDistance;
63  double mBaselineSimplificationTolerance;
64 
72  static bool closestSegmentPoints( QgsGeometry& g1, QgsGeometry& g2, double& dist, QgsPoint& pt1, QgsPoint& pt2 );
74  static QgsGeometry* closestMultilineElement( const QgsPoint& pt, QgsGeometry* multiLine );
80  QgsGeometry* clipBufferLine( const QgsGeometry* stratumGeom, QgsGeometry* clippedBaseline, double tolerance );
81 
83  double bufferDistance( double minDistanceFromAttribute ) const;
84 };
85 
86 #endif // QGSTRANSECTSAMPLE_H
A class for the creation of transect sample lines based on a set of strata polygons and baselines...
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:75
A class to represent a point.
Definition: qgspoint.h:63
General purpose distance and area calculator.
Represents a vector layer which manages a vector based data sets.