27 #include "../common/Translator.h" 
   28 #include "../dataaccess/dataset/DataSetAdapter.h" 
   29 #include "../dataaccess/dataset/DataSetTypeConverter.h" 
   30 #include "../dataaccess/dataset/FilteredDataSet.h" 
   31 #include "../dataaccess/query/DataSetName.h" 
   32 #include "../dataaccess/query/Field.h" 
   33 #include "../dataaccess/query/Fields.h" 
   34 #include "../dataaccess/query/From.h" 
   35 #include "../dataaccess/query/FromItem.h" 
   36 #include "../dataaccess/query/Select.h" 
   37 #include "../dataaccess/query/Where.h" 
   38 #include "../dataaccess/utils/Utils.h" 
   44 #include <boost/format.hpp> 
   62                                     const std::string& title,
 
   75   std::auto_ptr<te::da::DataSetType> type;
 
   76   type.reset(dynamic_cast<te::da::DataSetType*>(m_converter->getResult()->clone()));
 
   83   assert(!m_datasetName.empty());
 
   84   std::auto_ptr<te::da::DataSet> inputData, outputDataSet;
 
   88   inputData = ds->getDataSet(m_datasetName, travType, accessPolicy);
 
  100   assert(!m_datasetName.empty());
 
  104   std::auto_ptr<te::da::DataSetType> dsType = ds->getDataSetType(m_datasetName);
 
  106   if(dsType->hasGeom())
 
  108     return ds->getDataSet(m_datasetName, propertyName, e, r, travType, accessPolicy);
 
  112   std::auto_ptr<te::da::DataSet> inputData = ds->getDataSet(m_datasetName, travType, accessPolicy);
 
  115   std::auto_ptr<te::da::DataSet> adaptedDataSet;
 
  118   std::vector<std::size_t> positions;
 
  120   m_rtree.search(*(e), positions);
 
  122   adaptedDataSet->moveBeforeFirst();
 
  135   assert(!m_datasetName.empty());
 
  136   std::auto_ptr<te::da::DataSet> inputData, outputDataSet;
 
  140   inputData = ds->getDataSet(m_datasetName, propertyName, g, r, travType, accessPolicy);
 
  143   return outputDataSet;
 
  150   assert(!m_datasetName.empty());
 
  151   std::auto_ptr<te::da::DataSet> inputData, outputDataSet;
 
  165   from->push_back(fromItem);
 
  168   std::auto_ptr<te::da::Select> select(
new te::da::Select(all, from, filter));
 
  170   inputData = ds->query(select.get(), travType, accessPolicy);
 
  173   return outputDataSet;
 
  181   std::auto_ptr<te::da::DataSet> inputData, outputDataSet;
 
  185   inputData = ds->getDataSet(m_datasetName, oids, travType, accessPolicy);
 
  188   return outputDataSet;
 
  193   if(m_datasourceId.empty() || m_datasetName.empty())
 
  196   if(m_converter.get() == 0)
 
  209   if(ds.get() == 0 || !ds->isValid() || !ds->isOpened())
 
  217   if(m_rendererType.empty())
 
  218     throw Exception((boost::format(
TR_MAP(
"Could not draw the data set layer %1%. The renderer type is empty!")) % getTitle()).str());
 
  220   std::auto_ptr<te::da::DataSetType> dsType = getSchema();
 
  222   if(!dsType->hasGeom())
 
  227   if(renderer.get() == 0)
 
  228     throw Exception((boost::format(
TR_MAP(
"Could not draw the data set layer %1%. The renderer %2% could not be created!")) % getTitle() % m_rendererType).str());
 
  230   renderer->draw(
this, canvas, bbox, srid);
 
  235   return m_converter.get();
 
  240   m_converter = converter;
 
  244   std::auto_ptr<te::da::DataSetType> dsType = ds->getDataSetType(m_datasetName);
 
  246   if(!dsType->hasGeom() && m_converter->getResult()->hasGeom())
 
  251     std::auto_ptr<te::da::DataSet> inputData = ds->getDataSet(m_datasetName);
 
  254     std::auto_ptr<te::da::DataSet> adaptedDataSet;
 
  261     while(adaptedDataSet->moveNext())
 
  263       std::auto_ptr<te::gm::Geometry> geom(adaptedDataSet->getGeometry(geomPropPos));
 
  268       m_rtree.insert(env, pos);
 
  282   return m_datasetName;
 
  287   m_datasetName = name;
 
  292   return m_datasourceId;
 
  302   return m_rendererType;
 
DataSetAdapterLayer(AbstractLayer *parent=0)
It initializes a new layer. 
 
void setDataSetName(const std::string &name)
 
This class represents a set of unique ids created in the same context. i.e. from the same data set...
 
A class that models the name of a dataset used in a From clause. 
 
TEDATAACCESSEXPORT std::size_t GetFirstSpatialPropertyPos(const te::da::DataSet *dataset)
It returns the first dataset spatial property or NULL if none is found. 
 
const std::string & getDataSetName() const 
 
const std::string & getDataSourceId() const 
 
TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string &datasourceId, const bool opened=true)
Search for a data source with the informed id in the DataSourceManager. 
 
An converter for DataSetType. 
 
This is the base class for layers. 
 
A Select models a query to be used when retrieving data from a DataSource. 
 
A canvas is an abstraction of a drawing area. 
 
The Field class can be used to model an expression that takes part of the output items of a SELECT...
 
bool isValid() const 
It returns true if the layer can be used for instance to draw, otherwise, it returns false...
 
const std::string & getType() const 
It returns the layer type: DATASET_LAYER. 
 
boost::ptr_vector< FromItem > From
It models the FROM clause for a query. 
 
~DataSetAdapterLayer()
Destructor. 
 
SpatialRelation
Spatial relations between geometric objects. 
 
static AbstractRenderer * make(const std::string &factoryKey)
It creates an object with the appropriated factory. 
 
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers. 
 
AccessPolicy
Supported data access policies (can be used as bitfield). 
 
An abstract class that models a source of data in a query. 
 
An exception class for the MapTools module. 
 
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards. 
 
void draw(Canvas *canvas, const te::gm::Envelope &bbox, int srid)
It draws the layer geographic objects in the given canvas using the informed SRS. ...
 
std::auto_ptr< LayerSchema > getSchema() const 
It returns the layer schema. 
 
boost::shared_ptr< DataSource > DataSourcePtr
 
TraverseType
A dataset can be traversed in two ways: 
 
#define TR_MAP(message)
It marks a string in order to get translated. This is a special mark used in the Map Rendering module...
 
An abstract factory for layer renderers. 
 
void setDataSourceId(const std::string &id)
 
This is an abstract class that models a query expression. 
 
void setRendererType(const std::string &t)
 
std::auto_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. 
 
An Envelope defines a 2D rectangular region. 
 
A layer with reference to a DataSetTypeConverter. 
 
te::da::DataSetTypeConverter * getConverter() const 
It returns the DataSetTypeConverter. 
 
A class that can be used to model a filter expression that can be applied to a query. 
 
const std::string & getRendererType() const 
 
TEDATAACCESSEXPORT DataSetAdapter * CreateAdapter(DataSet *ds, DataSetTypeConverter *converter, bool isOwner=false)
 
static const std::string sm_type
A static data member used in the implementation of getType method. 
 
This class represents a filtered data set. 
 
void setConverter(std::auto_ptr< te::da::DataSetTypeConverter > converter)
It sets the converter that will be used by the layer.