-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6732 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
wonder
committed
Feb 28, 2007
1 parent
716fd14
commit f2cdb3c
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
class QgsDistanceArea | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsdistancearea.h> | ||
%End | ||
|
||
public: | ||
|
||
//! Constructor | ||
QgsDistanceArea(); | ||
|
||
//! Destructor | ||
~QgsDistanceArea(); | ||
|
||
//! sets whether coordinates must be projected to ellipsoid before measuring | ||
void setProjectionsEnabled(bool flag); | ||
|
||
//! returns projections enabled flag | ||
bool projectionsEnabled(); | ||
|
||
//! sets source spatial reference system (by QGIS SRS) | ||
void setSourceSRS(long srsid); | ||
|
||
//! returns source spatial reference system | ||
long sourceSRS(); | ||
//! What sort of coordinate system is being used? | ||
bool geographic(); | ||
|
||
//! sets ellipsoid by its acronym | ||
bool setEllipsoid(const QString& ellipsoid); | ||
|
||
//! returns ellipsoid's acronym | ||
const QString& ellipsoid(); | ||
|
||
//! returns ellipsoid's semi major axis | ||
double ellipsoidSemiMajor(); | ||
//! returns ellipsoid's semi minor axis | ||
double ellipsoidSemiMinor(); | ||
//! returns ellipsoid's inverse flattening | ||
double ellipsoidInvFlattening(); | ||
|
||
//! general measurement (line distance or polygon area) | ||
double measure(QgsGeometry* geometry); | ||
|
||
//! measures line with more segments | ||
// TODO wrap double measureLine(const std::vector<QgsPoint>& points); | ||
|
||
//! measures line with one segment | ||
double measureLine(const QgsPoint& p1, const QgsPoint& p2); | ||
|
||
//! measures polygon area | ||
// TODO wrap double measurePolygon(const std::vector<QgsPoint>& points); | ||
|
||
//! compute bearing - in radians | ||
double getBearing(const QgsPoint& p1, const QgsPoint& p2); | ||
|
||
static QString textUnit(double value, int decimals, QGis::units u, bool isArea); | ||
|
||
}; |