27 #include "../core/translator/Translator.h" 28 #include "../geometry/Curve.h" 29 #include "../geometry/Envelope.h" 30 #include "../geometry/LinearRing.h" 31 #include "../geometry/LineString.h" 32 #include "../geometry/Point.h" 33 #include "../geometry/Polygon.h" 34 #include "../geometry/MultiPolygon.h" 35 #include "../geometry/MultilineString.h" 36 #include "../geometry/MultiPoint.h" 37 #include "../geometry/Utils.h" 44 #include <terralib4/kernel/TeGeometry.h> 45 #include <terralib4/kernel/TeRepresentation.h> 49 std::unique_ptr<te::gm::Point> geom(
new te::gm::Point(pt.srid()));
50 geom->setX(pt.box().x1());
51 geom->setY(pt.box().y1());
59 TeComposite<TeCoord2D>::iterator it = line.begin();
62 while(it != line.end())
64 geom->setPoint(count, it->x(), it->y());
77 TeComposite<TeCoord2D>::iterator it = ring.begin();
80 while(it != ring.end())
82 geom->setPoint(count, it->x(), it->y());
95 TeComposite<TeLinearRing>::iterator it = poly.begin();
97 std::size_t count = 0;
98 while(it != poly.end())
113 TeComposite<TePolygon>::iterator it = polySet.begin();
115 while(it != polySet.end())
129 TeComposite<TeLine2D>::iterator it = lineSet.begin();
131 while(it != lineSet.end())
145 TeComposite<TePoint>::iterator it = pointSet.begin();
147 while(it != pointSet.end())
159 TeBox cellBox = cell.box();
165 std::unique_ptr<te::gm::Polygon> finalGeom(dynamic_cast<te::gm::Polygon*>(geom.release()));
172 TeGeomRep rep = geom.elemType();
178 TePolygon
p =
dynamic_cast<const TePolygon&
>(geom);
179 return std::unique_ptr<te::gm::Geometry>(
getPolygon(p).release());
184 TePoint
p =
dynamic_cast<const TePoint&
>(geom);
185 return std::unique_ptr<te::gm::Geometry>(
getPoint(p).release());
190 TeLine2D
p =
dynamic_cast<const TeLine2D&
>(geom);
191 return std::unique_ptr<te::gm::Geometry>(
getLineString(p).release());
196 TeCell
p =
dynamic_cast<const TeCell&
>(geom);
197 return std::unique_ptr<te::gm::Geometry>(
getPolygon(p).release());
202 TePoint
p =
dynamic_cast<const TePoint&
>(geom);
203 return std::unique_ptr<te::gm::Geometry>(
getPoint(p).release());
207 return std::unique_ptr<te::gm::Geometry>();
MultiPolygon is a MultiSurface whose elements are Polygons.
static std::unique_ptr< te::gm::Polygon > getPolygon(const TePolygon &poly)
static std::unique_ptr< te::gm::MultiPoint > getMultiPoint(const TePointSet &pointSet)
Utility functions for the Geometry Module.
static std::unique_ptr< te::gm::Point > getPoint(const TePoint &pt)
A LinearRing is a LineString that is both closed and simple.
MultiPoint is a GeometryCollection whose elements are restricted to points.
LineString is a curve with linear interpolation between points.
static std::unique_ptr< te::gm::Geometry > getGeometry(const TeGeometry &geom)
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
static std::unique_ptr< te::gm::LineString > getLineString(const TeLine2D &line)
static std::unique_ptr< te::gm::LinearRing > getLinearRing(const TeLinearRing &ring)
MultiLineString is a MultiCurve whose elements are LineStrings.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
static std::unique_ptr< te::gm::MultiPolygon > getMultiPolygon(const TePolygonSet &polySet)
An utility class for converting a TerraLib 4.x geometry to a TerraLib 5.
static std::unique_ptr< te::gm::MultiLineString > getMultiLineString(const TeLineSet &lineSet)
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
Configuration flags for the TerraLib 4 driver.