27 #include "../dataaccess/query/LiteralByteArray.h"
28 #include "../dataaccess/query/LiteralDateTime.h"
29 #include "../dataaccess/query/LiteralEnvelope.h"
30 #include "../dataaccess/query/LiteralGeom.h"
31 #include "../dataaccess/query/PropertyName.h"
32 #include "../dataaccess/query/ST_EnvelopeIntersects.h"
33 #include "../geometry/Envelope.h"
41 #include <boost/lexical_cast.hpp>
66 m_sql +=
" lower_x = " + boost::lexical_cast<std::string>(env->getLowerLeftX());
67 m_sql +=
" upper_x = " + boost::lexical_cast<std::string>(env->getUpperRightX());
68 m_sql +=
" lower_y = " + boost::lexical_cast<std::string>(env->getLowerLeftY());
69 m_sql +=
" upper_y = " + boost::lexical_cast<std::string>(env->getUpperRightY());
82 if(envIntersects == 0)
105 std::string lowerX =
"lower_x";
106 std::string upperX =
"upper_x";
107 std::string lowerY =
"lower_y";
108 std::string upperY =
"upper_y";
110 m_sql +=
"NOT("+ lowerX +
" > " + boost::lexical_cast<std::string>(e->
m_urx) +
" OR ";
111 m_sql += upperX +
" < " + boost::lexical_cast<std::string>(e->
m_llx) +
" OR ";
112 m_sql += lowerY +
" > " + boost::lexical_cast<std::string>(e->
m_ury) +
" OR ";
113 m_sql += upperY +
" < " + boost::lexical_cast<std::string>(e->
m_lly) +
")";
118 std::vector<std::string> values;
121 if(values.size() == 1)
124 m_sql += values[values.size() - 1];
const std::string & getName() const
It returns the property name.
Expression * getFirst() const
It returns the first function argument.
te::da::SQLDialect * dialect
A class that models the name of any property of an object.
SQLVisitor(const te::da::SQLDialect &dialect, std::string &sql, _ConnectionPtr conn)
Default constructor.
It represents the SQL query dialect accepted by a given data source.
double m_urx
Upper right corner x-coordinate.
A visitor for building an SQL statement using ADO dialect.
A class that models a literal for Date and Time values.
void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
It tokenizes a given string with a delimiter of your own choice.
double m_llx
Lower left corner x-coordinate.
An operator that considers the intersection among approximations or envelopes of geometries.
An Envelope defines a 2D rectangular region.
virtual void visit(const Expression &visited)
A class that models a literal for ByteArray values.
A class that models a Function expression.
void visit(const te::da::Function &visited)
A visitor for building an SQL statement using ADO dialect.
double m_lly
Lower left corner y-coordinate.
Utility functions for ADO.
double m_ury
Upper right corner y-coordinate.
A class that models a literal for Envelope values.
Expression * getSecond() const
It returns the second function argument.
te::dt::AbstractData * getValue() const
It returns the value associated to the literal.
te::gm::Envelope * getValue() const
It returns the associated envelope value.
A class that models a literal for Geometry values.