QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 );
30 
31  int createSample( QProgressDialog* pd );
32 
33  private:
34  QgsTransectSample(); //default constructor forbidden
35 
36  QgsGeometry* findBaselineGeometry( QVariant strataId );
37 
39  static bool otherTransectWithinDistance( QgsGeometry* geom, double minDistLayerUnit, double minDistance, QgsSpatialIndex& sIndex, const QMap< QgsFeatureId, QgsGeometry* >&
40  lineFeatureMap, QgsDistanceArea& da );
41 
42  QgsVectorLayer* mStrataLayer;
43  QString mStrataIdAttribute;
44  QString mMinDistanceAttribute;
45  QString mNPointsAttribute;
46 
47  QgsVectorLayer* mBaselineLayer;
48  bool mShareBaseline;
49  QString mBaselineStrataId;
50 
51  QString mOutputPointLayer;
52  QString mOutputLineLayer;
53  QString mUsedBaselineLayer;
54 
55  DistanceUnits mMinDistanceUnits;
56 
57  double mMinTransectLength;
58 
66  static bool closestSegmentPoints( QgsGeometry& g1, QgsGeometry& g2, double& dist, QgsPoint& pt1, QgsPoint& pt2 );
68  static QgsGeometry* closestMultilineElement( const QgsPoint& pt, QgsGeometry* multiLine );
74  static QgsGeometry* clipBufferLine( QgsGeometry* stratumGeom, QgsGeometry* clippedBaseline, double tolerance );
75 };
76 
77 #endif // QGSTRANSECTSAMPLE_H