27 #include "../common/STLUtils.h"
28 #include "../srs/Converter.h"
50 :
Curve(t, srid, mbr),
100 const std::size_t size = m_curves.size();
102 for(std::size_t i = 0; i < size; ++i)
103 m_curves[i]->transform(srid);
118 const std::size_t nSegs = size();
125 for(std::size_t i = 0; i < nSegs; ++i)
126 m_curves[i]->computeMBR(
true);
129 const Envelope* e = m_curves[0]->getMBR();
131 double minx = e->
m_llx;
132 double miny = e->
m_lly;
133 double maxx = e->
m_urx;
134 double maxy = e->
m_ury;
136 for(std::size_t i = 1; i < nSegs; ++i)
138 e = m_curves[i]->getMBR();
142 if(maxx < e->m_urx) maxx = e->
m_urx;
143 if(maxy < e->m_ury) maxy = e->
m_ury;
200 m_curves.push_back(c);
static const std::string sm_typeName
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
double getLength() const
The length of this Curve in its associated spatial reference.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
bool isClosed() const
It returns true if the curve is closed (startPoint = endPoint).
An exception class for the Geometry module.
void Clone(const std::vector< T * > &src, std::vector< T * > &dst)
This function can be applied to a vector of pointers.
An utility struct for representing 2D coordinates.
A point with z-coordinate value.
Curve * getCurve(std::size_t i) const
It returns the i-th curve.
Point * getStartPoint() const
It returns the curve start point.
Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of co...
~CompoundCurve()
Virtual destructor.
double m_lly
Lower left corner y-coordinate.
Geometry * locateBetween(const double &mStart, const double &mEnd) const
It returns a derived geometry collection value according to the range of coordinate values inclusivel...
A point with x and y coordinate values.
double m_ury
Upper right corner y-coordinate.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
void computeMBR(bool cascade) const
It computes the minimum bounding rectangle for the compound curve.
A point with x and y coordinate values.
CompoundCurve is a curve that may have circular and linear segments.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
void transform(int srid)
It converts the coordinate values of the compound curve to the new spatial reference system...
double m_urx
Upper right corner x-coordinate.
A point with a z-coordinate value and an associated measurement.
CompoundCurve & operator=(const CompoundCurve &rhs)
Assignment operator.
CompoundCurve(GeomType t, int srid=0, Envelope *mbr=0)
It initializes the compound curve with the specified spatial reference system id and envelope...
std::vector< Curve * > m_curves
The list of segments of the compund curve.
A base class for values that can be retrieved from the data access module.
CompoundCurve is a curve that may have circular and linear segments.
te::dt::AbstractData * clone() const
It clones the compound curve.
const std::string & getGeometryType() const
The name of instantiable subtype is: CompoundCurve.
std::size_t getNPoints() const
It returns the number of points (vertexes) in the compound curve.
double m_llx
Lower left corner x-coordinate.
An Envelope defines a 2D rectangular region.
void add(Curve *c)
It adds the curve to the compound.
An Envelope defines a 2D rectangular region.
A point with an associated measure.
void makeEmpty()
It clears all the segments.
void makeInvalid()
It will invalidated the envelope.
void setSRID(int srid)
It sets the Spatial Reference System ID of the compound curve.
Point * getEndPoint() const
It returns the curve end point.
virtual Curve & operator=(const Curve &rhs)
Assignment operator.