34 QgsDebugMsgLevel( QStringLiteral(
"Layer count: %1" ).arg( layers.count() ), 5 );
40 if ( layer->extent().isNull() )
56 QgsDebugMsg( QStringLiteral(
"Could not reproject layer extent" ) );
60 if ( fullExtent.
width() == 0.0 || fullExtent.
height() == 0.0 )
69 fullExtent.
set( -1.0, -1.0, 1.0, 1.0 );
73 const double padFactor = 1e-8;
74 double widthPad = fullExtent.
xMinimum() * padFactor;
75 double heightPad = fullExtent.
yMinimum() * padFactor;
76 double xmin = fullExtent.
xMinimum() - widthPad;
77 double xmax = fullExtent.
xMaximum() + widthPad;
78 double ymin = fullExtent.
yMinimum() - heightPad;
79 double ymax = fullExtent.
yMaximum() + heightPad;
80 fullExtent.
set( xmin, ymin, xmax, ymax );
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Custom exception class for Coordinate Reference System related exceptions.
static QgsRectangle combinedExtent(const QList< QgsMapLayer * > &layers, const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &transformContext)
Returns the combined extent of a list of layers.
Base class for all map layer types.
A rectangle specified with double values.
QString toString(int precision=16) const
Returns a string representation of form xmin,ymin : xmax,ymax Coordinates will be truncated to the sp...
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
double xMaximum() const SIP_HOLDGIL
Returns the x maximum value (right side of rectangle).
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
double height() const SIP_HOLDGIL
Returns the height of the rectangle.
void set(const QgsPointXY &p1, const QgsPointXY &p2, bool normalize=true)
Sets the rectangle from two QgsPoints.
void setMinimal() SIP_HOLDGIL
Set a rectangle so that min corner is at max and max corner is at min.
double width() const SIP_HOLDGIL
Returns the width of the rectangle.
void combineExtentWith(const QgsRectangle &rect)
Expands the rectangle so that it covers both the original rectangle and the given rectangle.
#define QgsDebugMsgLevel(str, level)
const QgsCoordinateReferenceSystem & crs