qt/widgets/canvas/Grid.cpp File Reference
#include "Grid.h"
#include "../../../common/StringUtils.h"
#include "../../../geometry/Envelope.h"
#include "../../../geometry/MultiLineString.h"
#include "../../../geometry/Utils.h"
#include "../../../maptools/Utils.h"
#include "../Utils.h"
#include "MapDisplay.h"
#include <QPainter>
#include <QPixmap>
#include <vector>

Go to the source code of this file.

Classes

class  WorldTransformer
 This class is used to transform coordinates in world coordinate system to the screen coordinate system. More...
 

Functions

std::vector< te::gm::LineStringCalculateHorizontalLines (const te::gm::Envelope &world, const double &horizontalLineInitial, const double &horizontalLineGap, const int &maxGaps)
 Calculates the lines in x-axis. More...
 
std::vector< te::gm::LineStringCalculateHorizontalLines (const te::gm::Envelope &planarBox, const te::gm::Envelope &geographicBox, const te::gm::Envelope &boxMM, const double &horizontalLineInitial, const double &horizontalLineGap, const int &maxGaps, const int &planarSRID, const int &geodesicSRID)
 Calculates the horizontal lines of the grid. More...
 
double CalculateInitialX (const te::gm::Envelope &env, const double &verticalLineInitial, const double &verticalLineGap)
 Calculates the initial coordinate in x-axis. More...
 
double CalculateInitialY (const te::gm::Envelope &env, const double &horizontalLineInitial, const double &horizontalLineGap)
 Calculates the initial coordinate in y-axis. More...
 
std::vector< te::gm::LineStringCalculateVerticalLines (const te::gm::Envelope &planarBox, const double &verticalLineInitial, const double &verticalLineGap, const int &maxGaps)
 Calculates the lines in y-axis. More...
 
std::vector< te::gm::LineStringCalculateVerticalLines (const te::gm::Envelope &planarBox, const te::gm::Envelope &geographicBox, const te::gm::Envelope &boxMM, const double &verticalLineInitial, const double &verticalLineGap, const int &maxGaps, const int &planarSRID, const int &geodesicSRID)
 Calculates the vertical lines of the grid. More...
 
std::string ConvertDecimalToDegree (const double &value, bool bDegrees, bool bMinutes, bool bSeconds, int precision)
 Converts a value to a degree-minute-second description. For presentation purposes. More...
 
void ConvertToMillimeter (const WorldTransformer &transf, te::gm::LineString *line)
 Converts the line from world coordinate system to device coordinate system. More...
 
void DrawAllLines (WorldTransformer transf, QPainter *painter, const std::vector< te::gm::LineString > &vlines, const std::vector< te::gm::LineString > &hlines, const QFont &font)
 Draw horizontal and vertical lines. More...
 
void DrawLine (QPainter *painter, QLineF &line, const int &txtOffSet, const bool &vertical)
 Draws the line using the giving painter. More...
 
void DrawLines (WorldTransformer transf, QPainter *painter, const std::vector< te::gm::LineString > &lines, const int &txtOffSet, const bool &vertical)
 Draws lines on painter. More...
 
void DrawTexts (WorldTransformer transf, QPainter *painter, const std::vector< te::gm::LineString > &vlines, const std::vector< te::gm::LineString > &hlines, const QFont &font)
 Draws all texts of the lines on the grid. More...
 
void GetGeographicCoordLine (WorldTransformer transf, te::gm::LineString &line, const int &geoSRID)
 Transforms a line from a coordinate system to another. More...
 
double GetInitialCoord (const double &initialCoord, const double &distance, double &gap)
 Calculates a suggar initial coordinate in world coordinate system. More...
 
void GetTextDimensions (const QFont font, const QString &text, int &w, int &h)
 Returns the dimensions of a text giving a font. More...
 
QPixmap * GetTextPixmap (const QString &txt, const QFont &font, const QPen &pen)
 Returns a pixmap with the text. More...
 
QPixmap * GetTextsPixmap (WorldTransformer transf, const std::vector< te::gm::LineString > &lines, const QFont &font, const QPen &pen, const bool &vertical, const QSize &displayDimensions)
 Returns an image with the headers of the grid. More...
 
QPixmap * GetTextsPixmap (WorldTransformer transf, const std::vector< te::gm::LineString > &lines, QPainter &painter, const bool &vertical, const bool &top, const int &geoSrid)
 Returns a pixmap with the values of the coordinates to be presented. More...
 
WorldTransformer GetTransformGeo (te::gm::Envelope boxgeo, te::gm::Envelope boxmm)
 Giving a box in world coordinate system and another in device coordinates, returns the WorldTransformer. More...
 
int PlanarSRID (const te::gm::Envelope &worldBox)
 Giving a box in world coordinate system, calculates the better SRID we must use to transform. More...
 
std::string Proj4DescToGeodesic ()
 Returns a default description for a geodesic coordinate system. More...
 
void RemapToPlanar (te::gm::LineString *line, int sourceSRID, int planarSRID)
 Transforms a LineString from a coordinate system to another. More...
 
int RoundNumber (const double &value)
 Retuns an rounded number. If the decimal part of number is less than .5, rounds to the floor, otherwise it will be rounded up. More...
 
void SetSRID (std::vector< te::gm::LineString > &lines, const int &srid)
 Sets the srid of a set of lines. More...
 
int ToGeographic (const te::gm::Envelope &worldBox, int sourceSRID)
 Calculates the srid for the better geodesic coordinate system, given a bounding rectangle and it's srid. More...
 
int ToPlanar (const te::gm::Envelope &worldBox, int sourceSRID)
 Calculates the srid for the better planar coordinate system, given a bounding rectangle and it's srid. More...
 
te::common::UnitOfMeasurePtr UnitMeasure (int srid)
 Returns the unit of measure of the given srid. More...
 
te::gm::Envelope WorldBoxTo (const te::gm::Envelope &worldBox, const unsigned int &sourceSRID, const unsigned int &targetSRID)
 Transforms the coordinates of an envelope from a system of coordinates to another. More...
 
te::gm::Envelope WorldBoxTo (const te::gm::Envelope &worldBox, int sourceSRID, int targetSRID)
 Transforms a bounding rectangle from a srid into another one. More...
 

Function Documentation

std::vector<te::gm::LineString> CalculateHorizontalLines ( const te::gm::Envelope world,
const double &  horizontalLineInitial,
const double &  horizontalLineGap,
const int maxGaps 
)

Calculates the lines in x-axis.

Parameters
worldBox in world coordinate system (MUST BE in a planar coordinate system).
horizontalLineInitialInital X.
horizontalLineGapDistance between lines in x-axis.
maxGapsMaximum number of lines to be presented on the grid.
Returns
A vector with the calculated lines in x-axis.

Definition at line 664 of file qt/widgets/canvas/Grid.cpp.

References CalculateInitialY(), te::gm::Envelope::getHeight(), te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::gm::LineStringType, and te::gm::LineString::setPoint().

Referenced by te::qt::widgets::Grid::makeGeographicGrid(), and te::qt::widgets::Grid::makePlanarGrid().

std::vector<te::gm::LineString> CalculateHorizontalLines ( const te::gm::Envelope planarBox,
const te::gm::Envelope geographicBox,
const te::gm::Envelope boxMM,
const double &  horizontalLineInitial,
const double &  horizontalLineGap,
const int maxGaps,
const int planarSRID,
const int geodesicSRID 
)

Calculates the horizontal lines of the grid.

Parameters
planarBoxBounding rectangle in planar coordinate system.
geographicBoxBounding rectangle in geographic coordinates.
boxMMBounding rectangle of the device in pixel coordinate system.
horizontalLineInitialInitial coordinate.
horizontalLineGapDifference between the coordinates.
maxGapsMaximum number of lines to be created.
planarSRIDSrid of a planar coordinate system.
geodesicSRIDSrid of a geographic coordinate system.
Returns
A vector with the created lines.
Note
If display is in a geographic coordinate system, planarBox MUST be an invalid rectangle and planarSRID MUST be the value -1. If both weren't correctly passed, this method may not work properly.

Definition at line 1314 of file qt/widgets/canvas/Grid.cpp.

References CalculateInitialY(), ConvertToMillimeter(), te::mnt::CreateLine, te::gm::GeometryCollection::getGeometryN(), te::gm::GetGeomFromEnvelope(), te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::GeometryCollection::getNumGeometries(), te::gm::Geometry::getSRID(), GetTransformGeo(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::gm::Geometry::intersection(), te::gm::Envelope::isValid(), line, te::gm::LineStringType, te::gm::MultiLineStringType, RemapToPlanar(), WorldTransformer::setMirroring(), and te::gm::LineString::setPoint().

double CalculateInitialX ( const te::gm::Envelope env,
const double &  verticalLineInitial,
const double &  verticalLineGap 
)

Calculates the initial coordinate in x-axis.

Parameters
envBounding rect in world coordinate system.
verticalLineInitialInitial coordinate in y-axis.
verticalLineGapDistance between two grid lines.
Returns
The initial value in the x-axis.

Definition at line 564 of file qt/widgets/canvas/Grid.cpp.

References te::gm::Envelope::getLowerLeftX().

Referenced by CalculateVerticalLines().

double CalculateInitialY ( const te::gm::Envelope env,
const double &  horizontalLineInitial,
const double &  horizontalLineGap 
)

Calculates the initial coordinate in y-axis.

Parameters
envBounding rect in world coordinate system.
horizontalLineInitialInitial coordinate in X-axis.
horizontalLineGapDistance between two grid lines.
Returns
The initial value in the y-axis.

Definition at line 592 of file qt/widgets/canvas/Grid.cpp.

References te::gm::Envelope::getLowerLeftY().

Referenced by CalculateHorizontalLines().

std::vector<te::gm::LineString> CalculateVerticalLines ( const te::gm::Envelope planarBox,
const double &  verticalLineInitial,
const double &  verticalLineGap,
const int maxGaps 
)

Calculates the lines in y-axis.

Parameters
planarBoxBox in world coordinate system (MUST BE in a planar coordinate system).
verticalLineInitialInital Y.
verticalLineGapDistance between lines in y-axis.
maxGapsMaximum number of lines to be presented on the grid.
Returns
A vector with the calculated lines in y-axis.

Definition at line 622 of file qt/widgets/canvas/Grid.cpp.

References CalculateInitialX(), te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::gm::Envelope::getWidth(), te::gm::LineStringType, and te::gm::LineString::setPoint().

Referenced by te::qt::widgets::Grid::makeGeographicGrid(), and te::qt::widgets::Grid::makePlanarGrid().

std::vector<te::gm::LineString> CalculateVerticalLines ( const te::gm::Envelope planarBox,
const te::gm::Envelope geographicBox,
const te::gm::Envelope boxMM,
const double &  verticalLineInitial,
const double &  verticalLineGap,
const int maxGaps,
const int planarSRID,
const int geodesicSRID 
)

Calculates the vertical lines of the grid.

Parameters
planarBoxBounding rectangle in planar coordinate system.
geographicBoxBounding rectangle in geographic coordinates.
boxMMBounding rectangle of the device in pixel coordinate system.
verticalLineInitialInitial coordinate.
verticalLineGapDifference between the coordinates.
maxGapsMaximum number of lines to be created.
planarSRIDSrid of a planar coordinate system.
geodesicSRIDSrid of a geographic coordinate system.
Returns
A vector with the created lines.
Note
If display is in a geographic coordinate system, planarBox MUST be an invalid rectangle and planarSRID MUST be the value -1. If both weren't correctly passed, this method may not work properly.

Definition at line 1208 of file qt/widgets/canvas/Grid.cpp.

References CalculateInitialX(), ConvertToMillimeter(), te::mnt::CreateLine, te::gm::GeometryCollection::getGeometryN(), te::gm::GetGeomFromEnvelope(), te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::GeometryCollection::getNumGeometries(), te::gm::Geometry::getSRID(), GetTransformGeo(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::gm::Geometry::intersection(), te::gm::Envelope::isValid(), line, te::gm::LineStringType, te::gm::MultiLineStringType, RemapToPlanar(), WorldTransformer::setMirroring(), and te::gm::LineString::setPoint().

std::string ConvertDecimalToDegree ( const double &  value,
bool  bDegrees,
bool  bMinutes,
bool  bSeconds,
int  precision 
)

Converts a value to a degree-minute-second description. For presentation purposes.

Parameters
valueValue to be converted. (MUST be in a geodesic coordinate system)
bDegreesTrue to degrees section to be presented, false otherwise.
bMinutesTrue to minutes section to be presented, false otherwise.
bSecondsTrue to seconds section to be presented, false otherwise.
precisionNumber of the decimals to be used.
Returns
Returns a text formatted as a degree-minute-second value.

Definition at line 1577 of file qt/widgets/canvas/Grid.cpp.

References te::common::Convert2String(), and RoundNumber().

Referenced by GetTextsPixmap().

void ConvertToMillimeter ( const WorldTransformer transf,
te::gm::LineString line 
)

Converts the line from world coordinate system to device coordinate system.

Parameters
transfWorldTransformer previously created with the both world rectangle and device rectangle.
lineThe line to be converted.

Definition at line 1162 of file qt/widgets/canvas/Grid.cpp.

References te::gm::LineString::computeMBR(), te::gm::LineString::getNPoints(), te::gm::LineString::getX(), te::gm::LineString::getY(), te::gm::LineString::setPoint(), te::gm::LineString::setSRID(), WorldTransformer::system1Tosystem2(), and TE_UNKNOWN_SRS.

Referenced by CalculateHorizontalLines(), and CalculateVerticalLines().

void DrawAllLines ( WorldTransformer  transf,
QPainter *  painter,
const std::vector< te::gm::LineString > &  vlines,
const std::vector< te::gm::LineString > &  hlines,
const QFont &  font 
)

Draw horizontal and vertical lines.

Parameters
transfThe world transformer being used.
painterThe painter being used.
vlinesSet of vertical lines.
hlinesSet of horizontal lines.
fontThe font to be used to render the texts.

Definition at line 868 of file qt/widgets/canvas/Grid.cpp.

References DrawLines(), and GetTextDimensions().

Referenced by te::qt::widgets::Grid::redraw().

void DrawLine ( QPainter *  painter,
QLineF &  line,
const int txtOffSet,
const bool vertical 
)

Draws the line using the giving painter.

Parameters
painterThe painter being used for rendering.
lineThe line to be drawed.
txtOffSetPosition of the text.
verticalSinalizes that the line analysed is a vertical or horizontal line.

Definition at line 784 of file qt/widgets/canvas/Grid.cpp.

References te::qt::widgets::MillimetersToPixels().

Referenced by DrawLines().

void DrawLines ( WorldTransformer  transf,
QPainter *  painter,
const std::vector< te::gm::LineString > &  lines,
const int txtOffSet,
const bool vertical 
)

Draws lines on painter.

Parameters
transfThe world transformer being used.
painterThe painter being used.
linesThe set of lines to be drawed
txtOffSetPosition of the text.
verticalSinalizes that the lines being analysed are vertical or horizontal lines.

Definition at line 833 of file qt/widgets/canvas/Grid.cpp.

References DrawLine(), line, and WorldTransformer::system1Tosystem2().

Referenced by DrawAllLines().

void DrawTexts ( WorldTransformer  transf,
QPainter *  painter,
const std::vector< te::gm::LineString > &  vlines,
const std::vector< te::gm::LineString > &  hlines,
const QFont &  font 
)

Draws all texts of the lines on the grid.

Parameters
transfThe world transformer being used.
painterThe painter being used.
vlinesSet of vertical lines.
hlinesSet of vertical lines.
fontThe font being used to draw texts.

Definition at line 1023 of file qt/widgets/canvas/Grid.cpp.

References dx, GetTextsPixmap(), and te::qt::widgets::MillimetersToPixels().

Referenced by te::qt::widgets::Grid::redraw().

void GetGeographicCoordLine ( WorldTransformer  transf,
te::gm::LineString line,
const int geoSRID 
)

Transforms a line from a coordinate system to another.

Parameters
transfWorldTransformer created with a planar bounding rectangle and the device bounding rectangle.
lineA line in device coordinate system.
geoSRIDThe srid of the geodesic coordinate system.

Definition at line 1532 of file qt/widgets/canvas/Grid.cpp.

References te::gm::LineString::getNPoints(), te::gm::LineString::getPointN(), te::gm::LineString::setPointN(), WorldTransformer::system2Tosystem1(), and te::gm::LineString::transform().

Referenced by GetTextsPixmap().

double GetInitialCoord ( const double &  initialCoord,
const double &  distance,
double &  gap 
)

Calculates a suggar initial coordinate in world coordinate system.

Parameters
initialCoordInitial coordinate.
distanceThe distance to be used.
[out]gapThe value of the distance between lines in axis.
Returns
A suggar value for initial coordinate.

Definition at line 702 of file qt/widgets/canvas/Grid.cpp.

Referenced by te::qt::widgets::Grid::makeGeographicGrid(), and te::qt::widgets::Grid::makePlanarGrid().

void GetTextDimensions ( const QFont  font,
const QString &  text,
int w,
int h 
)

Returns the dimensions of a text giving a font.

Parameters
fontThe font being used for the texts.
textThe text analysed.
[out]wThe calculated text width.
[out]hThe calculated text height.

Definition at line 765 of file qt/widgets/canvas/Grid.cpp.

Referenced by DrawAllLines(), GetTextPixmap(), and GetTextsPixmap().

QPixmap* GetTextPixmap ( const QString &  txt,
const QFont &  font,
const QPen &  pen 
)

Returns a pixmap with the text.

Parameters
txtThe text to be drawed.
fontThe font to be used.
penThe pen being used.
Returns
A pixmap with text and dimensions calculated based on font parameter.

Definition at line 891 of file qt/widgets/canvas/Grid.cpp.

References GetTextDimensions(), and p.

Referenced by GetTextsPixmap().

QPixmap* GetTextsPixmap ( WorldTransformer  transf,
const std::vector< te::gm::LineString > &  lines,
const QFont &  font,
const QPen &  pen,
const bool vertical,
const QSize &  displayDimensions 
)

Returns an image with the headers of the grid.

Parameters
transfThe world transformer being used.
linesThe calculated grid lines.
fontThe font to be used.
penThe pen being used.
verticalSinalizes that the lines being analysed are vertical or horizontal lines.
displayDimensionsDimensions of the canvas being used.
Returns
A pixmap with the header, over some axis, of the grid.

Definition at line 939 of file qt/widgets/canvas/Grid.cpp.

References col, GetTextDimensions(), GetTextPixmap(), p, and WorldTransformer::system1Tosystem2().

Referenced by DrawTexts(), and te::qt::widgets::Grid::redraw().

QPixmap* GetTextsPixmap ( WorldTransformer  transf,
const std::vector< te::gm::LineString > &  lines,
QPainter &  painter,
const bool vertical,
const bool top,
const int geoSrid 
)

Returns a pixmap with the values of the coordinates to be presented.

Parameters
transfWorldTransformer object previously created.
linesThe lines that are being processed
painterA QPainter object previously configured with the the color and font to use on presentation.
verticalFlag that sinalyzes if the pixmap is for the vertical lines or horizontal. (Depends on what lines are passed)
topFlag that sinalyzes in wich side will be placed the pixmap: true -> top and right, false -> bottom and left.
geoSridThe srid of the geodesic coordinate system to be used.
Returns
The pixmap to be placed on top, bottom, left or right position.
Note
If the display is in a geodesic coordinate the geoSrid MUST be defined as a valor different of -1.

Definition at line 1649 of file qt/widgets/canvas/Grid.cpp.

References ConvertDecimalToDegree(), GetGeographicCoordLine(), te::gm::LineString::getNPoints(), te::gm::LineString::getPointN(), GetTextDimensions(), GetTextPixmap(), line, p, and WorldTransformer::system2Tosystem1().

WorldTransformer GetTransformGeo ( te::gm::Envelope  boxgeo,
te::gm::Envelope  boxmm 
)

Giving a box in world coordinate system and another in device coordinates, returns the WorldTransformer.

Parameters
boxgeoBounding rectangle in world coordinate system.
boxmmBounding rectangle in device coordinate system.
Returns
The WorldTransformer object.

Definition at line 533 of file qt/widgets/canvas/Grid.cpp.

References te::gm::Envelope::isValid(), and WorldTransformer::setTransformationParameters().

Referenced by CalculateHorizontalLines(), CalculateVerticalLines(), and te::qt::widgets::Grid::redraw().

int PlanarSRID ( const te::gm::Envelope worldBox)

Giving a box in world coordinate system, calculates the better SRID we must use to transform.

Parameters
worldBoxBox in world coordinate system.
Returns
The id of the projection we must use to transform.

Definition at line 740 of file qt/widgets/canvas/Grid.cpp.

References te::map::CalculatePlanarZone(), te::gm::Envelope::getCenter(), te::gm::Coord2D::getY(), and TE_UNKNOWN_SRS.

Referenced by ToPlanar().

std::string Proj4DescToGeodesic ( )

Returns a default description for a geodesic coordinate system.

Returns
Default srid for the geodesic coordinate system. (EPSG:4326)

Definition at line 1400 of file qt/widgets/canvas/Grid.cpp.

Referenced by ToGeographic().

void RemapToPlanar ( te::gm::LineString line,
int  sourceSRID,
int  planarSRID 
)

Transforms a LineString from a coordinate system to another.

Parameters
lineLine to be converted.
sourceSRIDSrid of the line.
planarSRIDSrid of the output.

Definition at line 1104 of file qt/widgets/canvas/Grid.cpp.

References te::gm::LineString::computeMBR(), te::gm::LineString::getNPoints(), te::gm::LineString::getX(), te::gm::LineString::getY(), te::gm::LineString::makeEmpty(), te::gm::LineString::setNumCoordinates(), te::gm::LineString::setPoint(), and te::gm::LineString::setSRID().

Referenced by CalculateHorizontalLines(), and CalculateVerticalLines().

int RoundNumber ( const double &  value)

Retuns an rounded number. If the decimal part of number is less than .5, rounds to the floor, otherwise it will be rounded up.

Parameters
valueValue to be calculated.
Returns
The rounded number.

Definition at line 1554 of file qt/widgets/canvas/Grid.cpp.

Referenced by ConvertDecimalToDegree().

void SetSRID ( std::vector< te::gm::LineString > &  lines,
const int srid 
)

Sets the srid of a set of lines.

Parameters
linesThe lines to be updated.
sridThe new srid to be used.
Note
This method just sets the srid of the lines. It DOES NOT make any coordinate transformations.

Definition at line 1746 of file qt/widgets/canvas/Grid.cpp.

Referenced by te::qt::widgets::Grid::redraw().

int ToGeographic ( const te::gm::Envelope worldBox,
int  sourceSRID 
)

Calculates the srid for the better geodesic coordinate system, given a bounding rectangle and it's srid.

Parameters
worldBoxBounding rectangle in a planar coordinate system.
sourceSRIDThe srid of the input bounding rectangle.
Returns
Srid of the geodesic coordinate.

Definition at line 1498 of file qt/widgets/canvas/Grid.cpp.

References te::common::Convert2UCase(), te::common::Singleton< SpatialReferenceSystemManager >::getInstance(), te::gm::Envelope::isValid(), Proj4DescToGeodesic(), TE_UNKNOWN_SRS, and UnitMeasure().

Referenced by te::qt::widgets::Grid::initialize().

int ToPlanar ( const te::gm::Envelope worldBox,
int  sourceSRID 
)

Calculates the srid for the better planar coordinate system, given a bounding rectangle and it's srid.

Parameters
worldBoxBounding rectangle in a geodesic coordinate system.
sourceSRIDThe srid of the input bounding rectangle.
Returns
Srid of the better planar coordinate system found.

Definition at line 1470 of file qt/widgets/canvas/Grid.cpp.

References te::common::Convert2UCase(), te::gm::Envelope::isValid(), PlanarSRID(), TE_UNKNOWN_SRS, and UnitMeasure().

Referenced by te::qt::widgets::Grid::initialize(), and te::qt::widgets::Grid::makeGeographicGrid().

te::common::UnitOfMeasurePtr UnitMeasure ( int  srid)

Returns the unit of measure of the given srid.

Parameters
sridSrid of interest.
Returns
The corresponding unit of measure.

Definition at line 1419 of file qt/widgets/canvas/Grid.cpp.

References te::common::Singleton< SpatialReferenceSystemManager >::getInstance().

Referenced by ToGeographic(), and ToPlanar().

te::gm::Envelope WorldBoxTo ( const te::gm::Envelope worldBox,
const unsigned int sourceSRID,
const unsigned int targetSRID 
)

Transforms the coordinates of an envelope from a system of coordinates to another.

Parameters
worldBoxBounding rectangle.
sourceSRIDSrid of the bounding rectangle.
targetSRIDSrid of the new bounding rectangle.
Returns
The bounding rectangle in the targetSRID coordinate system.

Definition at line 1077 of file qt/widgets/canvas/Grid.cpp.

References te::common::Singleton< SpatialReferenceSystemManager >::getInstance(), te::gm::Envelope::isValid(), and te::gm::Envelope::transform().

Referenced by te::qt::widgets::Grid::makeGeographicGrid().

te::gm::Envelope WorldBoxTo ( const te::gm::Envelope worldBox,
int  sourceSRID,
int  targetSRID 
)

Transforms a bounding rectangle from a srid into another one.

Parameters
worldBoxBounding rectangle in some coordinate system.
sourceSRIDThe srid of the rectangle.
targetSRIDThe srid of the output rectangle.
Returns
A bounding rectangle in the targetSRID coordinate system, or an invalid bounding rectangle, if the operation couldn't be done.

Definition at line 1442 of file qt/widgets/canvas/Grid.cpp.

References te::common::Singleton< SpatialReferenceSystemManager >::getInstance(), te::gm::Envelope::isValid(), and te::gm::Envelope::transform().