16 #ifndef QGSDISTANCEAREA_H 17 #define QGSDISTANCEAREA_H 59 void setEllipsoidalMode(
bool flag );
73 bool willUseEllipsoid()
const;
76 void setSourceCrs(
long srsid );
85 void setSourceAuthId(
const QString& authid );
90 Q_DECL_DEPRECATED
long sourceCrs()
const {
return mCoordTransform->sourceCrs().srsid(); }
96 long sourceCrsId()
const {
return mCoordTransform->sourceCrs().srsid(); }
99 bool geographic()
const {
return mCoordTransform->sourceCrs().geographicFlag(); }
108 bool setEllipsoid(
const QString& ellipsoid );
118 bool setEllipsoid(
double semiMajor,
double semiMinor );
139 Q_DECL_DEPRECATED
double measure(
const QgsGeometry* geometry )
const;
150 double measureArea(
const QgsGeometry* geometry )
const;
161 double measureLength(
const QgsGeometry* geometry )
const;
172 double measurePerimeter(
const QgsGeometry *geometry )
const;
226 Q_DECL_DEPRECATED
static QString textUnit(
double value,
int decimals,
QGis::UnitType u,
bool isArea,
bool keepBaseUnit =
false );
238 static QString formatDistance(
double distance,
int decimals,
QGis::UnitType unit,
bool keepBaseUnit =
false );
265 double convertLengthMeasurement(
double length,
QGis::UnitType toUnits )
const;
294 double* course1 =
nullptr,
double* course2 =
nullptr )
const;
314 void computeAreaInit();
332 bool mEllipsoidalMode;
338 double mSemiMajor, mSemiMinor, mInvFlattening;
342 double getQ(
double x )
const;
343 double getQbar(
double x )
const;
346 double measureLine(
const QgsCurveV2* curve )
const;
347 double measurePolygon(
const QgsCurveV2* curve )
const;
351 double m_QA, m_QB, m_QC;
352 double m_QbarA, m_QbarB, m_QbarC, m_QbarD;
double ellipsoidSemiMajor() const
returns ellipsoid's semi major axis
double ellipsoidSemiMinor() const
returns ellipsoid's semi minor axis
Abstract base class for all geometries.
double ellipsoidInverseFlattening() const
returns ellipsoid's inverse flattening
A geometry is the spatial representation of a feature.
Q_DECL_DEPRECATED long sourceCrs() const
returns source spatial reference system
bool geographic() const
What sort of coordinate system is being used?
long sourceCrsId() const
Returns the QgsCoordinateReferenceSystem::srsid() for the CRS used during calculations.
A class to represent a point.
General purpose distance and area calculator.
QString ellipsoid() const
Returns ellipsoid's acronym.
bool ellipsoidalEnabled() const
Returns whether ellipsoidal calculations are enabled.
Class for storing a coordinate reference system (CRS)
UnitType
Map units that qgis supports.
Abstract base class for curved geometry type.