QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
16 #ifndef QGSDISTANCEAREA_H
17 #define QGSDISTANCEAREA_H
19 #include "qgis_core.h"
21 #include <QReadWriteLock>
62 bool willUseEllipsoid()
const;
94 bool setEllipsoid(
const QString &ellipsoid );
103 bool setEllipsoid(
double semiMajor,
double semiMinor );
149 double measureArea(
const QgsGeometry &geometry )
const;
161 double measureLength(
const QgsGeometry &geometry )
const;
173 double measurePerimeter(
const QgsGeometry &geometry )
const;
181 double measureLine(
const QVector<QgsPointXY> &points )
const;
206 double measureLineProjected(
const QgsPointXY &p1,
double distance = 1,
double azimuth = M_PI_2,
QgsPointXY *projectedPoint
SIP_OUT =
nullptr )
const;
225 double measurePolygon(
const QVector<QgsPointXY> &points )
const;
256 static QString formatArea(
double area,
int decimals,
QgsUnitTypes::AreaUnit unit,
bool keepBaseUnit =
false );
301 QgsPointXY computeSpheroidProject(
const QgsPointXY &p1,
double distance = 1,
double azimuth = M_PI_2 )
const;
322 QVector<QVector<QgsPointXY> > geodesicLine(
const QgsPointXY &p1,
const QgsPointXY &p2,
double interval,
bool breakLine =
false )
const;
380 double *course1 =
nullptr,
double *course2 =
nullptr )
const;
386 double computePolygonArea(
const QVector<QgsPointXY> &points )
const;
388 double computePolygonFlatArea(
const QVector<QgsPointXY> &points )
const;
394 void computeAreaInit();
412 double mSemiMajor, mSemiMinor, mInvFlattening;
416 double getQ(
double x )
const;
417 double getQbar(
double x )
const;
420 double measureLine(
const QgsCurve *curve )
const;
421 double measurePolygon(
const QgsCurve *curve )
const;
425 double m_QA, m_QB, m_QC;
426 double m_QbarA, m_QbarB, m_QbarC, m_QbarD;
Abstract base class for curved geometry type.
QString ellipsoid() const
Returns ellipsoid's acronym.
Contains information about the context in which a coordinate transform is executed.
const QgsCoordinateReferenceSystem & crs
QgsCoordinateReferenceSystem sourceCrs() const
Returns the source spatial reference system.
DistanceUnit
Units of distance.
double ellipsoidInverseFlattening() const
Returns ellipsoid's inverse flattening.
QgsCoordinateReferenceSystem ellipsoidCrs() const
Returns the ellipsoid (destination) spatial reference system.
double ellipsoidSemiMajor() const
Returns the ellipsoid's semi major axis.
double ellipsoidSemiMinor() const
Returns ellipsoid's semi minor axis.
This class represents a coordinate reference system (CRS).
Abstract base class for all geometries.
A class to represent a 2D point.
Contains parameters for an ellipsoid.
A geometry is the spatial representation of a feature.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.