16 #ifndef QGSDISTANCEAREA_H 17 #define QGSDISTANCEAREA_H 19 #include "qgis_core.h" 21 #include <QReadWriteLock> 62 bool willUseEllipsoid()
const;
85 bool setEllipsoid(
const QString &ellipsoid );
94 bool setEllipsoid(
double semiMajor,
double semiMinor );
139 double measureArea(
const QgsGeometry &geometry )
const;
151 double measureLength(
const QgsGeometry &geometry )
const;
163 double measurePerimeter(
const QgsGeometry &geometry )
const;
171 double measureLine(
const QVector<QgsPointXY> &points )
const;
196 double measureLineProjected(
const QgsPointXY &p1,
double distance = 1,
double azimuth = M_PI_2,
QgsPointXY *projectedPoint
SIP_OUT =
nullptr )
const;
215 double measurePolygon(
const QVector<QgsPointXY> &points )
const;
246 static QString formatArea(
double area,
int decimals,
QgsUnitTypes::AreaUnit unit,
bool keepBaseUnit =
false );
289 QgsPointXY computeSpheroidProject(
const QgsPointXY &p1,
double distance = 1,
double azimuth = M_PI_2 )
const;
304 double *course1 =
nullptr,
double *course2 =
nullptr )
const;
310 double computePolygonArea(
const QVector<QgsPointXY> &points )
const;
312 double computePolygonFlatArea(
const QVector<QgsPointXY> &points )
const;
318 void computeAreaInit();
336 double mSemiMajor, mSemiMinor, mInvFlattening;
340 double getQ(
double x )
const;
341 double getQbar(
double x )
const;
344 double measureLine(
const QgsCurve *curve )
const;
345 double measurePolygon(
const QgsCurve *curve )
const;
349 double m_QA, m_QB, m_QC;
350 double m_QbarA, m_QbarB, m_QbarC, m_QbarD;
double ellipsoidSemiMajor() const
Returns the ellipsoid's semi major axis.
A class to represent a 2D point.
double ellipsoidSemiMinor() const
Returns ellipsoid's semi minor axis.
double ellipsoidInverseFlattening() const
Returns ellipsoid's inverse flattening.
A geometry is the spatial representation of a feature.
Contains parameters for an ellipsoid.
Abstract base class for curved geometry type.
Abstract base class for all geometries.
Contains information about the context in which a coordinate transform is executed.
DistanceUnit
Units of distance.
QgsCoordinateReferenceSystem sourceCrs() const
Returns the source spatial reference system.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations...
QString ellipsoid() const
Returns ellipsoid's acronym.
This class represents a coordinate reference system (CRS).