QGIS API Documentation
2.8.2-Wien
|
General purpose distance and area calculator. More...
#include <qgsdistancearea.h>
Public Member Functions | |
QgsDistanceArea () | |
Constructor. | |
QgsDistanceArea (const QgsDistanceArea &origDA) | |
Copy constructor. | |
~QgsDistanceArea () | |
Destructor. | |
double | bearing (const QgsPoint &p1, const QgsPoint &p2) |
compute bearing - in radians | |
void | convertMeasurement (double &measure, QGis::UnitType &measureUnits, QGis::UnitType displayUnits, bool isArea) |
Helper for conversion between physical units. | |
const QString & | ellipsoid () const |
returns ellipsoid's acronym | |
bool | ellipsoidalEnabled () const |
returns projections enabled flag | |
double | ellipsoidInverseFlattening () const |
returns ellipsoid's inverse flattening | |
double | ellipsoidSemiMajor () const |
returns ellipsoid's semi major axis | |
double | ellipsoidSemiMinor () const |
returns ellipsoid's semi minor axis | |
bool | geographic () const |
What sort of coordinate system is being used? | |
double | measure (QgsGeometry *geometry) |
general measurement (line distance or polygon area) | |
double | measureLine (const QList< QgsPoint > &points) |
measures line | |
double | measureLine (const QgsPoint &p1, const QgsPoint &p2) |
measures line with one segment | |
double | measurePerimeter (QgsGeometry *geometry) |
measures perimeter of polygon | |
double | measurePolygon (const QList< QgsPoint > &points) |
measures polygon area | |
QgsDistanceArea & | operator= (const QgsDistanceArea &origDA) |
Assignment operator. | |
bool | setEllipsoid (const QString &ellipsoid) |
sets ellipsoid by its acronym | |
bool | setEllipsoid (double semiMajor, double semiMinor) |
Sets ellipsoid by supplied radii. | |
void | setEllipsoidalMode (bool flag) |
sets whether coordinates must be projected to ellipsoid before measuring | |
void | setSourceAuthId (QString authid) |
sets source spatial reference system by authid | |
void | setSourceCrs (long srsid) |
sets source spatial reference system (by QGIS CRS) | |
void | setSourceCrs (const QgsCoordinateReferenceSystem &srcCRS) |
Sets source spatial reference system (by QGIS CRS) | |
long | sourceCrs () const |
returns source spatial reference system |
Static Public Member Functions | |
static QString | textUnit (double value, int decimals, QGis::UnitType u, bool isArea, bool keepBaseUnit=false) |
Protected Member Functions | |
void | computeAreaInit () |
precalculates some values (must be called always when changing ellipsoid) | |
double | computeDistance (const QList< QgsPoint > &points) |
calculate distance with given coordinates (does not do a transform anymore) | |
double | computeDistanceBearing (const QgsPoint &p1, const QgsPoint &p2, double *course1=NULL, double *course2=NULL) |
calculates distance from two points on ellipsoid based on inverse Vincenty's formulae | |
double | computeDistanceFlat (const QgsPoint &p1, const QgsPoint &p2) |
uses flat / planimetric / Euclidean distance | |
double | computePolygonArea (const QList< QgsPoint > &points) |
calculates area of polygon on ellipsoid algorithm has been taken from GRASS: gis/area_poly1.c | |
double | computePolygonFlatArea (const QList< QgsPoint > &points) |
const unsigned char * | measureLine (const unsigned char *feature, double *area, bool hasZptr=false) |
measures line distance, line points are extracted from WKB | |
const unsigned char * | measurePolygon (const unsigned char *feature, double *area, double *perimeter, bool hasZptr=false) |
measures polygon area and perimeter, vertices are extracted from WKB |
General purpose distance and area calculator.
Definition at line 34 of file qgsdistancearea.h.
QgsDistanceArea::QgsDistanceArea | ( | ) |
Constructor.
Definition at line 41 of file qgsdistancearea.cpp.
QgsDistanceArea::~QgsDistanceArea | ( | ) |
Destructor.
Definition at line 57 of file qgsdistancearea.cpp.
QgsDistanceArea::QgsDistanceArea | ( | const QgsDistanceArea & | origDA | ) |
Copy constructor.
Definition at line 52 of file qgsdistancearea.cpp.
compute bearing - in radians
Definition at line 619 of file qgsdistancearea.cpp.
|
protected |
precalculates some values (must be called always when changing ellipsoid)
Definition at line 792 of file qgsdistancearea.cpp.
|
protected |
calculate distance with given coordinates (does not do a transform anymore)
Definition at line 726 of file qgsdistancearea.cpp.
|
protected |
calculates distance from two points on ellipsoid based on inverse Vincenty's formulae
Points p1 and p2 are expected to be in degrees and in currently used ellipsoid
Definition at line 644 of file qgsdistancearea.cpp.
uses flat / planimetric / Euclidean distance
Definition at line 721 of file qgsdistancearea.cpp.
|
protected |
calculates area of polygon on ellipsoid algorithm has been taken from GRASS: gis/area_poly1.c
Definition at line 827 of file qgsdistancearea.cpp.
|
protected |
Definition at line 884 of file qgsdistancearea.cpp.
void QgsDistanceArea::convertMeasurement | ( | double & | measure, |
QGis::UnitType & | measureUnits, | ||
QGis::UnitType | displayUnits, | ||
bool | isArea | ||
) |
Helper for conversion between physical units.
Definition at line 1034 of file qgsdistancearea.cpp.
|
inline |
returns ellipsoid's acronym
Definition at line 80 of file qgsdistancearea.h.
|
inline |
returns projections enabled flag
Definition at line 53 of file qgsdistancearea.h.
|
inline |
returns ellipsoid's inverse flattening
Definition at line 87 of file qgsdistancearea.h.
|
inline |
returns ellipsoid's semi major axis
Definition at line 83 of file qgsdistancearea.h.
|
inline |
returns ellipsoid's semi minor axis
Definition at line 85 of file qgsdistancearea.h.
|
inline |
What sort of coordinate system is being used?
Definition at line 70 of file qgsdistancearea.h.
double QgsDistanceArea::measure | ( | QgsGeometry * | geometry | ) |
general measurement (line distance or polygon area)
Definition at line 257 of file qgsdistancearea.cpp.
double QgsDistanceArea::measureLine | ( | const QList< QgsPoint > & | points | ) |
measures line
Definition at line 419 of file qgsdistancearea.cpp.
measures line with one segment
Definition at line 461 of file qgsdistancearea.cpp.
|
protected |
measures line distance, line points are extracted from WKB
Definition at line 392 of file qgsdistancearea.cpp.
double QgsDistanceArea::measurePerimeter | ( | QgsGeometry * | geometry | ) |
measures perimeter of polygon
Definition at line 332 of file qgsdistancearea.cpp.
double QgsDistanceArea::measurePolygon | ( | const QList< QgsPoint > & | points | ) |
measures polygon area
Definition at line 592 of file qgsdistancearea.cpp.
|
protected |
measures polygon area and perimeter, vertices are extracted from WKB
Definition at line 497 of file qgsdistancearea.cpp.
QgsDistanceArea & QgsDistanceArea::operator= | ( | const QgsDistanceArea & | origDA | ) |
Assignment operator.
Definition at line 63 of file qgsdistancearea.cpp.
bool QgsDistanceArea::setEllipsoid | ( | const QString & | ellipsoid | ) |
sets ellipsoid by its acronym
Definition at line 112 of file qgsdistancearea.cpp.
bool QgsDistanceArea::setEllipsoid | ( | double | semiMajor, |
double | semiMinor | ||
) |
Sets ellipsoid by supplied radii.
Definition at line 245 of file qgsdistancearea.cpp.
void QgsDistanceArea::setEllipsoidalMode | ( | bool | flag | ) |
sets whether coordinates must be projected to ellipsoid before measuring
Definition at line 88 of file qgsdistancearea.cpp.
void QgsDistanceArea::setSourceAuthId | ( | QString | authid | ) |
sets source spatial reference system by authid
Definition at line 105 of file qgsdistancearea.cpp.
void QgsDistanceArea::setSourceCrs | ( | long | srsid | ) |
sets source spatial reference system (by QGIS CRS)
Definition at line 93 of file qgsdistancearea.cpp.
void QgsDistanceArea::setSourceCrs | ( | const QgsCoordinateReferenceSystem & | srcCRS | ) |
Sets source spatial reference system (by QGIS CRS)
Definition at line 100 of file qgsdistancearea.cpp.
|
inline |
returns source spatial reference system
Definition at line 68 of file qgsdistancearea.h.
|
static |
Definition at line 905 of file qgsdistancearea.cpp.