27 #include "../common/Translator.h"
28 #include "../dataaccess/dataset/DataSetType.h"
29 #include "../raster/Band.h"
30 #include "../raster/BandProperty.h"
31 #include "../raster/Grid.h"
32 #include "../raster/Raster.h"
33 #include "../raster/RasterFactory.h"
39 #include <boost/filesystem.hpp>
40 #include <boost/format.hpp>
55 const std::string& title,
76 std::vector<te::rst::BandProperty*> bprops;
87 std::string path =
"";
89 std::map<std::string, std::string>::const_iterator it = m_rinfo.find(
"URI");
91 if(it != m_rinfo.end())
96 boost::filesystem::path rpath (path);
105 return std::auto_ptr<LayerSchema>(ls);
111 return std::auto_ptr<te::da::DataSet>(0);
120 return std::auto_ptr<te::da::DataSet>(0);
129 return std::auto_ptr<te::da::DataSet>(0);
136 return std::auto_ptr<te::da::DataSet>(0);
143 return std::auto_ptr<te::da::DataSet>(0);
154 if(m_rendererType.empty())
155 throw Exception((boost::format(
TR_MAP(
"Could not draw the data set layer %1%. The renderer type is empty!")) % getTitle()).str());
159 if(renderer.get() == 0)
160 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());
162 renderer->draw(
this, canvas, bbox, srid);
172 return m_rendererType;
static const std::string sm_type
A static data member used in the implementation of getType method.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
const std::string & getType() const
It returns the layer type: RASTER_LAYER.
This is the base class for layers.
A layer with reference to a raster.
A canvas is an abstraction of a drawing area.
std::map< std::string, std::string > getRasterInfo() const
Grid * getGrid()
It returns the raster grid.
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. ...
void add(Constraint *c)
It adds a new constraint.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
SpatialRelation
Spatial relations between geometric objects.
const std::string & getRendererType() const
static AbstractRenderer * make(const std::string &factoryKey)
It creates an object with the appropriated factory.
AccessPolicy
Supported data access policies (can be used as bitfield).
std::auto_ptr< LayerSchema > getSchema() const
It returns the layer schema.
~RasterLayer()
Destructor.
RasterLayer(AbstractLayer *parent=0)
It initializes a new layer.
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
A rectified grid is the spatial support for raster data.
void setRendererType(const std::string &t)
An exception class for the MapTools module.
int getSRID() const
Returns the raster spatial reference system identifier.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
void setRasterInfo(const std::map< std::string, std::string > &rinfo)
bool isValid() const
It returns true if the layer can be used for instance to draw, otherwise, it returns false...
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...
A raster band description.
te::rst::Raster * getRaster() const
A class that models the description of a dataset.
static Raster * open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
It opens a raster with the given parameters and default raster driver.
An abstract factory for layer renderers.
This is an abstract class that models a query expression.
An abstract class for raster data strucutures.
BandProperty * getProperty()
Returns the band property.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
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.