27 #include "../../common/STLUtils.h" 28 #include "../../core/translator/Translator.h" 29 #include "../../geometry/Envelope.h" 30 #include "../../geometry/Geometry.h" 31 #include "../../geometry/Utils.h" 32 #include "../Exception.h" 51 m_isFromEnvelope(false),
81 for(std::size_t i = 0; i < size; ++i)
163 bool hasEnvelope =
true;
225 throw Exception(
TE_TR(
"The spatial function not have a literal geometry or literal envelope!"));
230 throw Exception(
TE_TR(
"The spatial function not have a property name!"));
Expression * getArg(std::size_t i) const
It returns the i-th function argument.
te::gm::SpatialRelation m_type
The spatial restriction type.
const std::string & getName() const
It returns the property name.
A visitor that retrieves spatial restrictions from a Query hierarchy.
bool isSpatialRestrictionFunction(const Function &f) const
A class that models a Function expression.
static const std::string sm_ST_Equals
std::size_t m_index
Internal index of the spatial restriction.
const std::vector< te::da::SpatialRestriction * > & getSpatialRestrictions() const
static const std::string sm_ST_Overlaps
A class that models the name of any property of an object.
std::vector< te::da::SpatialRestriction * > m_spatialRestrictions
The set of spatial restrictions.
A class that models the name of any property of an object.
Base exception class for plugin module.
static const std::string sm_ST_Touches
static const std::string sm_ST_Intersects
SpatialRestrictionVisitor()
Default constructor.
SpatialRestriction()
Default constructor.
SpatialRelation
Spatial relations between geometric objects.
bool hasSpatialRestrictions() const
virtual ReturnType accept(VisitorType &guest) const =0
It call the visit method from the guest object.
#define TE_TR(message)
It marks a string in order to get translated.
static const std::string sm_ST_Contains
This is an abstract class that models a query expression.
void addSpatialRestriction(const Function &f)
A class that models a literal for Envelope values.
bool isFromEnvelope(const Function &f) const
static const std::string sm_ST_Crosses
te::gm::Geometry * getGeometryRestriction(const Function &f) const
const Function * m_function
The function that represents the spatial restriction.
An Envelope defines a 2D rectangular region.
A struct that represents a spatial restriction.
bool m_isFromEnvelope
A flag that indicates if the spatial restriction uses an envelope.
std::size_t m_index
An internal visitor index.
A class that can be used to model a filter expression that can be applied to a query.
This is an abstract class that models a query expression.
virtual AbstractData * clone() const =0
It returns a clone of this object.
virtual ~SpatialRestrictionVisitor()
Virtual destructor.
A base class for values that can be retrieved from the data access module.
Expression * getExp() const
A class that models a Function expression.
A Select models a query to be used when retrieving data from a data source.
const std::string & getName() const
It returns the function name.
std::string m_pname
The property name of the spatial restriction.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A Select models a query to be used when retrieving data from a DataSource.
int getSRID() const
It returns the envelope SRS id.
A class that can be used to model a filter expression that can be applied to a query.
Where * getWhere() const
It returns the filter condition.
static const std::string sm_ST_Disjoint
te::gm::Geometry * m_geometry
The geometry of the spatial restriction.
virtual void visit(const Expression &visited)
virtual void initialize()
static const std::string sm_ST_Within
std::map< std::string, te::gm::SpatialRelation > m_spatialFunctions
A map of spatial restriction functions.
A class that models a literal for Envelope values.
A static class with global function name definitions.
std::string getPropertyName(const Function &f) const
~SpatialRestriction()
Destructor.
A class that models a literal for Geometry values.
te::gm::SpatialRelation getSpatialRelation(const Function &f) const
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...
std::size_t getNumArgs() const
It returns the number of arguments informed to the function.
te::gm::Envelope * getValue() const
It returns the associated envelope value.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
A class that models a literal for Geometry values.