27 #include "../common/Translator.h"
28 #include "../geometry/Curve.h"
29 #include "../geometry/LinearRing.h"
30 #include "../geometry/LineString.h"
31 #include "../geometry/Point.h"
32 #include "../geometry/Polygon.h"
33 #include "../geometry/MultiPolygon.h"
34 #include "../geometry/MultilineString.h"
35 #include "../geometry/MultiPoint.h"
42 #include <terralib/kernel/TeGeometry.h>
43 #include <terralib/kernel/TeRepresentation.h>
47 std::auto_ptr<te::gm::Point> geom(
new te::gm::Point(pt.srid()));
48 geom->setX(pt.box().x1());
49 geom->setY(pt.box().y1());
57 TeComposite<TeCoord2D>::iterator it = line.begin();
60 while(it != line.end())
62 geom->setPoint(count, it->x(), it->y());
75 TeComposite<TeCoord2D>::iterator it = ring.begin();
78 while(it != ring.end())
80 geom->setPoint(count, it->x(), it->y());
93 TeComposite<TeLinearRing>::iterator it = poly.begin();
95 std::size_t count = 0;
96 while(it != poly.end())
98 geom->setRingN(count, getLinearRing(*it).release());
111 TeComposite<TePolygon>::iterator it = polySet.begin();
113 while(it != polySet.end())
115 geom->add(getPolygon(*it).release());
127 TeComposite<TeLine2D>::iterator it = lineSet.begin();
129 while(it != lineSet.end())
131 geom->add(getLineString(*it).release());
143 TeComposite<TePoint>::iterator it = pointSet.begin();
145 while(it != pointSet.end())
147 geom->add(getPoint(*it).release());
159 TeBox cellBox = cell.box();
162 s->
setPoint(0, cellBox.x1(), cellBox.y1());
163 s->
setPoint(1, cellBox.x2()-cellBox.x1(), cellBox.y1());
164 s->
setPoint(2, cellBox.x2(), cellBox.y2());
165 s->
setPoint(3, cellBox.x1(), cellBox.y2()-cellBox.y1());
166 s->
setPoint(4, cellBox.x1(), cellBox.y1());
175 TeGeomRep rep = geom.elemType();
181 TePolygon p =
dynamic_cast<const TePolygon&
>(geom);
182 return std::auto_ptr<te::gm::Geometry>(getPolygon(p).release());
187 TePoint p =
dynamic_cast<const TePoint&
>(geom);
188 return std::auto_ptr<te::gm::Geometry>(getPoint(p).release());
193 TeLine2D p =
dynamic_cast<const TeLine2D&
>(geom);
194 return std::auto_ptr<te::gm::Geometry>(getLineString(p).release());
199 TePolygon p =
dynamic_cast<const TePolygon&
>(geom);
200 return std::auto_ptr<te::gm::Geometry>(getPolygon(p).release());
205 TePoint p =
dynamic_cast<const TePoint&
>(geom);
206 return std::auto_ptr<te::gm::Geometry>(getPoint(p).release());
210 throw Exception(
TR_TERRALIB4(
"Geometry Type Not supported!"));
215 return std::auto_ptr<te::gm::Geometry>(0);
MultiLineString is a MultiCurve whose elements are LineStrings.
static std::auto_ptr< te::gm::LinearRing > getLinearRing(const TeLinearRing &ring)
static std::auto_ptr< te::gm::MultiPolygon > getMultiPolygon(const TePolygonSet &polySet)
static std::auto_ptr< te::gm::MultiPoint > getMultiPoint(const TePointSet &pointSet)
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
A LinearRing is a LineString that is both closed and simple.
#define TR_TERRALIB4(message)
It marks a string in order to get translated. This is a special mark used in the DataAccess module of...
An utility class for converting a TerraLib 4.x geometry to a TerraLib 5.
static std::auto_ptr< te::gm::MultiLineString > getMultiLineString(const TeLineSet &lineSet)
LineString is a curve with linear interpolation between points.
MultiPolygon is a MultiSurface whose elements are Polygons.
static std::auto_ptr< te::gm::Point > getPoint(const TePoint &pt)
Utilitary functions for dealing with TerraLib 5 and 4.x conversion.
A point with x and y coordinate values.
static std::auto_ptr< te::gm::Geometry > getGeometry(const TeGeometry &geom)
static std::auto_ptr< te::gm::Polygon > getPolygon(const TePolygon &poly)
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point.
Configuration flags for the TerraLib 4 driver.
MultiPoint is a GeometryCollection whose elements are restricted to points.
static std::auto_ptr< te::gm::LineString > getLineString(const TeLine2D &line)