Skip to content


Browse files Browse the repository at this point in the history
Bindings: wrapped QgsDistanceArea
git-svn-id: c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Feb 28, 2007
1 parent 716fd14 commit f2cdb3c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/core/core.sip
Expand Up @@ -14,6 +14,7 @@
%Include qgscoordinatetransform.sip
%Include qgsdataprovider.sip
%Include qgsdatasourceuri.sip
%Include qgsdistancearea.sip
%Include qgsfeature.sip
%Include qgsfeatureattribute.sip
%Include qgsfield.sip
Expand Down
60 changes: 60 additions & 0 deletions python/core/qgsdistancearea.sip
@@ -0,0 +1,60 @@

class QgsDistanceArea
#include <qgsdistancearea.h>


//! Constructor

//! Destructor

//! 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);


0 comments on commit f2cdb3c

Please sign in to comment.