27 #include "../core/translator/Translator.h" 28 #include "../dataaccess/query/DataSetName.h" 29 #include "../dataaccess/query/Field.h" 30 #include "../dataaccess/query/Fields.h" 31 #include "../dataaccess/query/From.h" 32 #include "../dataaccess/query/FromItem.h" 33 #include "../dataaccess/query/Select.h" 34 #include "../dataaccess/query/SpatialQueryProcessor.h" 35 #include "../dataaccess/query/Where.h" 36 #include "../dataaccess/utils/Utils.h" 37 #include "../geometry/GeometryProperty.h" 38 #include "../raster/Grid.h" 39 #include "../raster/RasterProperty.h" 50 #include <boost/format.hpp> 70 const std::string& title,
128 std::unique_ptr<LayerSchema> type = ds->getDataSetType(
m_datasetName);
132 m_schema = static_cast<LayerSchema*>(type->clone());
142 std::unique_ptr<LayerSchema> type = ds->getDataSetType(
m_datasetName);
145 return std::unique_ptr<te::da::DataSetType>();
164 return ds->getDataSet(
m_datasetName, travType, accessPolicy);
179 return ds->getDataSet(
m_datasetName, propertyName, e, r, travType, accessPolicy);
194 return ds->getDataSet(
m_datasetName, propertyName, g, r, travType, accessPolicy);
218 from->push_back(fromItem);
224 return sqp.
getDataSet(ds, select.get(), travType);
237 return ds->getDataSet(
m_datasetName, oids, travType, accessPolicy);
256 if(ds.get() ==
nullptr || !ds->isValid() || !ds->isOpened())
265 throw Exception((boost::format(
TE_TR(
"Could not draw the data set layer %1%. The renderer type is empty!")) %
getTitle()).str());
269 if(renderer.get() ==
nullptr)
272 renderer->draw(
this, canvas, bbox, srid, scale, cancel);
TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string &datasourceId, const bool opened=true)
Search for a data source with the informed id in the DataSourceManager.
TEDATAACCESSEXPORT te::rst::RasterProperty * GetFirstRasterProperty(const DataSetType *dt)
std::string m_datasetName
The dataset name where we will retrieve the layer objects.
An abstract class that models a source of data in a query.
The Field class can be used to model an expression that takes part of the output items of a SELECT...
void setSRID(int srid)
It sets the spatial reference system identifier associated to this property.
TEMAPEXPORT void CopyAbstractLayerInfo(const te::map::AbstractLayer *refLayer, te::map::AbstractLayer *layer)
Make a copy of refLayer abstract attributes to layer. Creating new id.
This is the base class for layers.
Property * clone() const
It returns a clone of the object.
A class that models the name of a dataset used in a From clause.
boost::shared_ptr< DataSource > DataSourcePtr
virtual const std::string & getTitle() const
It returns the layer title.
bool hasGeom() const
It returns true if the DataSetType has at least one geometry property; otherwise, it returns false...
~DataSetLayer()
Destructor.
Base exception class for plugin module.
A class that models the description of a dataset.
An abstract factory for layer renderers.
std::string m_rendererType
A pointer to the internal renderer used to paint this layer.
void setSRID(int srid)
It sets the Spatial Reference System ID associated to the Layer.
SpatialRelation
Spatial relations between geometric objects.
std::unique_ptr< LayerSchema > getSchema() const
It returns the layer schema.
static te::dt::Date ds(2010, 01, 01)
A layer with reference to a dataset.
#define TE_TR(message)
It marks a string in order to get translated.
std::unique_ptr< te::da::DataSet > getData(te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const
It gets the dataset identified by the layer name.
A basic query processor for spatial restrictions.
This is an abstract class that models a query expression.
int m_srid
The identifier of the layer spatial reference system.
te::core::EncodingType getEncoding() const
It returns the encoding type.
void setRendererType(const std::string &t)
AbstractLayer * clone()
It returns a clone of the object.
AccessPolicy
Supported data access policies (can be used as bitfield).
TraverseType
A dataset can be traversed in two ways:
static const std::string sm_type
A static data member used in the implementation of getType method.
virtual void setOutOfDate()
Its indicate that the layer schema is out of date.
An Envelope defines a 2D rectangular region.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
bool hasRaster() const
It returns true if the DataSetType has at least one raster property; otherwise, it returns false...
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
const std::string & getType() const
It returns the layer type: DATASET_LAYER.
A class that can be used to model a filter expression that can be applied to a query.
virtual std::unique_ptr< DataSet > getDataSet(const DataSourcePtr &ds, const Select &q, te::common::TraverseType travType=te::common::FORWARDONLY)
Utility functions for the data access module.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
static AbstractRenderer * make(const std::string &factoryKey)
It creates an object with the appropriated factory.
A Select models a query to be used when retrieving data from a DataSource.
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
virtual void select(te::da::ObjectIdSet *oids)
It adds the given oids to the selected group of this Layer.
te::rst::Grid * getGrid()
Returns the definition of the raster grid support.
A canvas is an abstraction of a drawing area.
std::string m_datasourceId
DataSource id.
LayerSchema * m_schema
The dataset schema.
A layer with reference to a dataset.
void setSRID(int srid)
Just sets the grid spatial reference system identifier.
DataSetLayer(AbstractLayer *parent=0)
It initializes a new layer.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
void draw(Canvas *canvas, const te::gm::Envelope &bbox, int srid, const double &scale, bool *cancel)
It draws the layer geographic objects in the given canvas using the informed SRS. ...
bool isValid() const
It returns true if the layer can be used for instance to draw, otherwise, it returns false...
const std::string & getRendererType() const