QGIS API Documentation
2.6.0-Brighton
|
General purpose distance and area calculator. More...
#include <qgsdistancearea.h>
Public Member Functions | |
QgsDistanceArea () | |
Constructor. | |
~QgsDistanceArea () | |
Destructor. | |
QgsDistanceArea (const QgsDistanceArea &origDA) | |
Copy constructor. | |
QgsDistanceArea & | operator= (const QgsDistanceArea &origDA) |
Assignment operator. | |
void | setEllipsoidalMode (bool flag) |
sets whether coordinates must be projected to ellipsoid before measuring | |
bool | ellipsoidalEnabled () const |
returns projections enabled flag | |
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) | |
void | setSourceAuthId (QString authid) |
sets source spatial reference system by authid | |
long | sourceCrs () const |
returns source spatial reference system | |
bool | geographic () const |
What sort of coordinate system is being used? | |
bool | setEllipsoid (const QString &ellipsoid) |
sets ellipsoid by its acronym | |
bool | setEllipsoid (double semiMajor, double semiMinor) |
Sets ellipsoid by supplied radii. | |
const QString & | ellipsoid () const |
returns ellipsoid's acronym | |
double | ellipsoidSemiMajor () const |
returns ellipsoid's semi major axis | |
double | ellipsoidSemiMinor () const |
returns ellipsoid's semi minor axis | |
double | ellipsoidInverseFlattening () const |
returns ellipsoid's inverse flattening | |
double | measure (QgsGeometry *geometry) |
general measurement (line distance or polygon area) | |
double | measurePerimeter (QgsGeometry *geometry) |
measures perimeter of polygon | |
double | measureLine (const QList< QgsPoint > &points) |
measures line | |
double | measureLine (const QgsPoint &p1, const QgsPoint &p2) |
measures line with one segment | |
double | measurePolygon (const QList< QgsPoint > &points) |
measures polygon area | |
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. |
Static Public Member Functions | |
static QString | textUnit (double value, int decimals, QGis::UnitType u, bool isArea, bool keepBaseUnit=false) |
Protected Member Functions | |
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 | |
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 | computeDistance (const QList< QgsPoint > &points) |
calculate distance with given coordinates (does not do a transform anymore) | |
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) |
void | computeAreaInit () |
precalculates some values (must be called always when changing ellipsoid) |
General purpose distance and area calculator.
QgsDistanceArea::QgsDistanceArea | ( | ) |
Constructor.
QgsDistanceArea::~QgsDistanceArea | ( | ) |
Destructor.
QgsDistanceArea::QgsDistanceArea | ( | const QgsDistanceArea & | origDA | ) |
Copy constructor.
compute bearing - in radians
|
protected |
precalculates some values (must be called always when changing ellipsoid)
|
protected |
calculate distance with given coordinates (does not do a transform anymore)
|
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
uses flat / planimetric / Euclidean distance
|
protected |
calculates area of polygon on ellipsoid algorithm has been taken from GRASS: gis/area_poly1.c
|
protected |
void QgsDistanceArea::convertMeasurement | ( | double & | measure, |
QGis::UnitType & | measureUnits, | ||
QGis::UnitType | displayUnits, | ||
bool | isArea | ||
) |
Helper for conversion between physical units.
|
inline |
returns ellipsoid's acronym
|
inline |
returns projections enabled flag
|
inline |
returns ellipsoid's inverse flattening
|
inline |
returns ellipsoid's semi major axis
|
inline |
returns ellipsoid's semi minor axis
|
inline |
What sort of coordinate system is being used?
double QgsDistanceArea::measure | ( | QgsGeometry * | geometry | ) |
general measurement (line distance or polygon area)
double QgsDistanceArea::measureLine | ( | const QList< QgsPoint > & | points | ) |
measures line
measures line with one segment
|
protected |
measures line distance, line points are extracted from WKB
double QgsDistanceArea::measurePerimeter | ( | QgsGeometry * | geometry | ) |
measures perimeter of polygon
double QgsDistanceArea::measurePolygon | ( | const QList< QgsPoint > & | points | ) |
measures polygon area
|
protected |
measures polygon area and perimeter, vertices are extracted from WKB
QgsDistanceArea & QgsDistanceArea::operator= | ( | const QgsDistanceArea & | origDA | ) |
Assignment operator.
bool QgsDistanceArea::setEllipsoid | ( | const QString & | ellipsoid | ) |
sets ellipsoid by its acronym
bool QgsDistanceArea::setEllipsoid | ( | double | semiMajor, |
double | semiMinor | ||
) |
Sets ellipsoid by supplied radii.
void QgsDistanceArea::setEllipsoidalMode | ( | bool | flag | ) |
sets whether coordinates must be projected to ellipsoid before measuring
void QgsDistanceArea::setSourceAuthId | ( | QString | authid | ) |
sets source spatial reference system by authid
void QgsDistanceArea::setSourceCrs | ( | long | srsid | ) |
sets source spatial reference system (by QGIS CRS)
void QgsDistanceArea::setSourceCrs | ( | const QgsCoordinateReferenceSystem & | srcCRS | ) |
Sets source spatial reference system (by QGIS CRS)
|
inline |
returns source spatial reference system
|
static |