16 #ifndef QGSDISTANCEAREA_H
17 #define QGSDISTANCEAREA_H
50 void setEllipsoidalMode(
bool flag );
56 void setSourceCrs(
long srsid );
65 void setSourceAuthId( QString authid );
68 long sourceCrs()
const {
return mCoordTransform->sourceCrs().srsid(); }
70 bool geographic()
const {
return mCoordTransform->sourceCrs().geographicFlag(); }
73 bool setEllipsoid(
const QString& ellipsoid );
77 bool setEllipsoid(
double semiMajor,
double semiMinor );
80 const QString&
ellipsoid()
const {
return mEllipsoid; }
96 double measureLine(
const QList<QgsPoint>& points );
102 double measurePolygon(
const QList<QgsPoint>& points );
107 static QString textUnit(
double value,
int decimals,
QGis::UnitType u,
bool isArea,
bool keepBaseUnit =
false );
115 const unsigned char* measureLine(
const unsigned char* feature,
double* area,
bool hasZptr =
false );
118 const unsigned char* measurePolygon(
const unsigned char* feature,
double* area,
double* perimeter,
bool hasZptr =
false );
131 double* course1 = NULL,
double* course2 = NULL );
137 double computeDistance(
const QList<QgsPoint>& points );
144 double computePolygonArea(
const QList<QgsPoint>& points );
146 double computePolygonFlatArea(
const QList<QgsPoint>& points );
152 void computeAreaInit();
162 bool mEllipsoidalMode;
168 double mSemiMajor, mSemiMinor, mInvFlattening;
172 double getQ(
double x );
173 double getQbar(
double x );
177 double m_QA, m_QB, m_QC;
178 double m_QbarA, m_QbarB, m_QbarC, m_QbarD;