27 #include "../common/Exception.h"
28 #include "../common/Translator.h"
29 #include "../srs/Converter.h"
50 return Coord2D(m_llx + (m_urx - m_llx) / 2.0, m_lly + (m_ury - m_lly) / 2.0);
62 dx = rhs.
m_llx - m_urx;
66 dx = m_llx - rhs.
m_urx;
72 dy = rhs.
m_lly - m_ury;
76 dy = m_lly - rhs.
m_ury;
86 return sqrt((dx * dx) + (dy * dy));
91 if(oldsrid == newsrid)
98 converter->setSourceSRID(oldsrid);
99 converter->setTargetSRID(newsrid);
106 double x1, x2, x3, x4;
107 double y1, y2, y3, y4;
110 converter->convert(m_llx, m_lly, x1, y1);
111 converter->convert(m_urx, m_lly, x2, y2);
112 converter->convert(m_urx, m_ury, x3, y3);
113 converter->convert(m_llx, m_ury, x4, y4);
116 m_llx = std::min(std::min(x1,x4),std::min(x2,x3));
117 m_urx = std::max(std::max(x1,x4),std::max(x2,x3));
118 m_lly = std::min(std::min(y1,y4),std::min(y2,y3));
119 m_ury = std::max(std::max(y1,y4),std::max(y2,y3));
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
double distance(const Envelope &rhs) const
It returns the shortest distance between any two points in the two envelopes.
An utility struct for representing 2D coordinates.
An utility struct for representing 2D coordinates.
Coord2D getUpperRight() const
It returns the upper right coordinate of the envelope.
double m_lly
Lower left corner y-coordinate.
double m_ury
Upper right corner y-coordinate.
double m_urx
Upper right corner x-coordinate.
Coord2D getCenter() const
It returns the rectangle's center coordinate.
void transform(int oldsrid, int newsrid)
It will transform the coordinates of the Envelope from the old SRS to the new one.
A Converter is responsible for the conversion of coordinates between different Coordinate Systems (CS...
double m_llx
Lower left corner x-coordinate.
An Envelope defines a 2D rectangular region.
An Envelope defines a 2D rectangular region.
Coord2D getLowerLeft() const
It returns the lower left coordinate of the envelope.