27 #include "../datatype/DateTime.h" 28 #include "../dataaccess/query/LiteralByteArray.h" 29 #include "../dataaccess/query/LiteralDateTime.h" 30 #include "../dataaccess/query/LiteralEnvelope.h" 31 #include "../dataaccess/query/LiteralGeom.h" 46 assert(visited.
getValue() !=
nullptr);
52 assert(visited.
getValue() !=
nullptr);
54 std::string dateStr = dateTime->
toString();
55 auto pos = dateStr.find(
"OFF");
56 if(pos != std::string::npos)
57 dateStr = dateStr.replace(pos, 3,
"");
59 m_sql+=
"\'"+dateStr+
"\'";
64 assert(visited.
getValue() !=
nullptr);
70 assert(visited.
getValue() !=
nullptr);
76 m_sql +=
"DISTINCT (";
78 for (std::size_t i = 0; i < visited.size(); ++i)
83 visited[i].accept(*
this);
te::da::SQLDialect * dialect
A visitor for building an SQL statement using PostGIS dialect.
boost::ptr_vector< Expression > Distinct
A class that models a Distinct clause on a query.
PGconn * m_conn
The PostGIS connection used to escape string!
Utility functions for PostgreSQL.
It represents the SQL query dialect accepted by a given data source.
A visitor for building an SQL statement using PostGIS dialect.
A class that models a literal for Date and Time values.
virtual std::string toString() const =0
It returns the data value in a string notation.
void Convert2PostGIS(const te::gm::Envelope *e, int srid, std::string &output)
It converts the envelope into a PostGIS BOX3D.
A class that models a literal for ByteArray values.
std::string & m_sql
The buffer string where the query will be outputed.
int getSRID() const
It returns the envelope SRS id.
void visit(const te::da::LiteralByteArray &visited)
void visitDistinct(const te::da::Distinct &visited)
A class that models a literal for Envelope values.
SQLVisitor(const te::da::SQLDialect &dialect, std::string &sql, PGconn *conn)
Default constructor.
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.