27 #include "../common/Exception.h" 28 #include "../common/STLUtils.h" 29 #include "../core/translator/Translator.h" 30 #include "../dataaccess/dataset/ObjectId.h" 31 #include "../datatype/SimpleData.h" 32 #include "../geometry/Coord2D.h" 33 #include "../geometry/Envelope.h" 34 #include "../geometry/Geometry.h" 35 #include "../geometry/Point.h" 36 #include "../geometry/Utils.h" 84 if(pos == std::string::npos)
114 if(pos == std::string::npos)
122 assert(pos != std::string::npos);
143 if(pos == std::string::npos)
160 for(std::size_t i = 0; i <
m_features.size(); ++i)
164 return std::string::npos;
186 std::vector<te::edit::Feature*> result;
189 std::vector<std::size_t> report;
192 for(std::size_t i = 0; i < report.size(); ++i)
194 std::size_t pos = report[i];
208 for (std::size_t i = 0; i <
m_features.size(); ++i)
217 std::vector<te::edit::Feature*> candidates =
getFeatures(e, srid);
219 if (candidates.empty())
229 for (std::size_t i = 0; i < candidates.size(); ++i)
231 if (!candidates[i]->isEditable())
239 if (g->
contains(&point) || g->
crosses(geometryFromEnvelope.get()) || geometryFromEnvelope->contains(g))
240 return candidates[i];
263 for(std::size_t i = 0; i <
m_features.size(); ++i)
269 assert(pos != std::string::npos);
void add(te::da::ObjectId *id, te::gm::Geometry *geom)
void set(te::da::ObjectId *id, te::gm::Geometry *geom)
Feature * getFeature(const te::gm::Envelope &e, int srid) const
TEEDITEXPORT te::da::ObjectId * GenerateId()
const std::vector< Feature * > & getAllFeatures() const
te::sam::rtree::Index< std::size_t, 8 > m_rtree
Internal index used to retrieve geometries spatially.
te::da::ObjectId * getId() const
te::gm::Geometry * getGeometry() const
An utility struct for representing 2D coordinates.
Repository(const std::string &source)
#define TE_TR(message)
It marks a string in order to get translated.
This class represents a geographic feature.
bool hasIdentifier(te::da::ObjectId *id)
Coord2D getCenter() const
It returns the rectangle's center coordinate.
int getSRID() const _NOEXCEPT_OP(true)
It returns the Spatial Reference System ID associated to this geometric object.
A point with x and y coordinate values.
const Envelope * getMBR() const _NOEXCEPT_OP(true)
It returns the minimum bounding rectangle for the geometry in an internal representation.
An Envelope defines a 2D rectangular region.
void add(te::gm::Geometry *geom)
void remove(te::da::ObjectId *id)
This class represents an unique id for a data set element.
This class represents a repository of geometries and features.
virtual bool contains(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if this geometry object spatially contains rhs geometry.
std::vector< Feature * > m_features
The repository features.
int search(const te::gm::Envelope &mbr, std::vector< DATATYPE > &report) const
Range search query.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
std::string m_source
The source of the features.
std::vector< Feature * > getFeatures(const te::gm::Envelope &e, int srid) const
void insert(const te::gm::Envelope &mbr, const DATATYPE &data)
It inserts an item into the tree.
std::size_t getPosition(te::da::ObjectId *id)
const std::string & getSource() const
virtual bool crosses(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object spatially crosses rhs geometry.
virtual void transform(int srid) _NOEXCEPT_OP(false)=0
It converts the coordinate values of the geometry to the new spatial reference system.
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 isValid() const
It tells if the rectangle is valid or not.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.