Subgroup: Referenced

Class: QgsReferencedRectangle

class qgis.core.QgsReferencedRectangle

Bases: qgis._core.QgsRectangle, qgis._core.QgsReferencedGeometryBase

A QgsRectangle with associated coordinate reference system.

New in version 3.0: Methods

area Returns the area of the rectangle.
asPolygon Returns the rectangle as a polygon.
asWktCoordinates Returns a string representation of the rectangle in WKT format.
asWktPolygon Returns a string representation of the rectangle as a WKT Polygon.
buffered Get rectangle enlarged by buffer.
center Returns the center point of the rectangle.
combineExtentWith Expand the rectangle so that covers both the original rectangle and the given rectangle.
contains Return true when rectangle contains other rectangle.
crs Returns the associated coordinate reference system, or an invalid CRS if no reference system is set.
fromCenterAndSize Creates a new rectangle, given the specified center point and width and height.
fromWkt Creates a new rectangle from a wkt string.
grow Grows the rectangle in place by the specified amount.
height Returns the height of the rectangle.
include Updates the rectangle to include the specified point.
intersect Return the intersection with the given rectangle.
intersects Returns true when rectangle intersects with other rectangle.
invert Swap x/y coordinates in the rectangle.
isEmpty Returns true if the rectangle is empty.
isFinite Returns true if the rectangle has finite boundaries.
isNull Test if the rectangle is null (all coordinates zero or after call to setMinimal()).
normalize Normalize the rectangle so it has non-negative width/height.
perimeter Returns the perimeter of the rectangle.
scale Scale the rectangle around its center point.
set Sets the rectangle from two QgsPoints.
setCrs Sets the associated crs.
setMinimal Set a rectangle so that min corner is at max and max corner is at min.
setXMaximum Set the maximum x value.
setXMinimum Set the minimum x value.
setYMaximum Set the maximum y value.
setYMinimum Set the minimum y value.
toBox3d Converts the rectangle to a 3D box, with the specified zMin and zMax z values.
toRectF Returns a QRectF with same coordinates as the rectangle.
toString Returns a string representation of form xmin,ymin : xmax,ymax Coordinates will be truncated to the specified precision.
width Returns the width of the rectangle.
xMaximum Returns the x maximum value (right side of rectangle).
xMinimum Returns the x minimum value (left side of rectangle).
yMaximum Returns the y maximum value (top side of rectangle).
yMinimum Returns the y minimum value (bottom side of rectangle).

Attributes