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(
TE_TR(
"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(
TE_TR(
"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;
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
A layer with reference to a raster.
~RasterLayer()
Destructor.
This is the base class for layers.
void setRasterInfo(const std::map< std::string, std::string > &rinfo)
A raster band description.
A class that models the description of a dataset.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
An abstract factory for layer renderers.
te::rst::Raster * getRaster() const
SpatialRelation
Spatial relations between geometric objects.
std::map< std::string, std::string > getRasterInfo() const
#define TE_TR(message)
It marks a string in order to get translated.
RasterLayer(AbstractLayer *parent=0)
It initializes a new layer.
This is an abstract class that models a query expression.
AccessPolicy
Supported data access policies (can be used as bitfield).
TraverseType
A dataset can be traversed in two ways:
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...
An abstract class for raster data strucutures.
bool isValid() const
It returns true if the layer can be used for instance to draw, otherwise, it returns false...
BandProperty * getProperty()
Returns the band property.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
Grid * getGrid()
It returns the raster grid.
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.
void add(Constraint *c)
It adds a new constraint.
A canvas is an abstraction of a drawing area.
int getSRID() const
Returns the raster spatial reference system identifier.
std::auto_ptr< LayerSchema > getSchema() const
It returns the layer schema.
static const std::string sm_type
A static data member used in the implementation of getType method.
const std::string & getType() const
It returns the layer type: RASTER_LAYER.
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.
A rectified grid is the spatial support for raster data.
void setRendererType(const std::string &t)
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. ...
const std::string & getRendererType() const
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.