diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2016-08-05 22:21:12 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2016-11-30 08:54:11 +0000 |
commit | cd8880cc04b22610e835e6cc02cc16ac22ec9fae (patch) | |
tree | 37a5569c4eca55f70d5584f54fa2479dcf9dad3c /src/positioning/qgeoshape.cpp | |
parent | 0a552f285fdc3760d9755109ceef3b87392a308d (diff) | |
download | qtlocation-cd8880cc04b22610e835e6cc02cc16ac22ec9fae.tar.gz |
Add support for boundingGeoRectangle to QGeoShape
this patch introduces QGeoShape::boundingGeoRectangle,
which returns a QGeoRectangle containing the latitudinal/longitudinal bounds
of a geoshape.
The bounding geo rectangle is projection independent, as it returns
a georectangle containing the min/max latitudes/longitudes of the
shape.
Change-Id: Ie3a83ec41f87ea3753899d2278e664fe2469f778
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/positioning/qgeoshape.cpp')
-rw-r--r-- | src/positioning/qgeoshape.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/positioning/qgeoshape.cpp b/src/positioning/qgeoshape.cpp index bac37605..dd358fb5 100644 --- a/src/positioning/qgeoshape.cpp +++ b/src/positioning/qgeoshape.cpp @@ -227,6 +227,22 @@ bool QGeoShape::contains(const QGeoCoordinate &coordinate) const } /*! + Returns a \a QGeoRectangle representing the geographical bounding rectangle of the + geo shape, that defines the latitudinal/longitudinal bounds of the geo shape. + + \since 5.9 +*/ +QGeoRectangle QGeoShape::boundingGeoRectangle() const +{ + Q_D(const QGeoShape); + + if (d) + return d->boundingGeoRectangle(); + else + return QGeoRectangle(); +} + +/*! Returns the coordinate located at the geometric center of the geo shape. \since 5.5 |