27 #include "../core/translator/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" 40 #include <boost/filesystem.hpp> 41 #include <boost/format.hpp> 56 const std::string& title,
90 std::vector<te::rst::BandProperty*> bprops;
103 std::map<std::string, std::string>::const_iterator it =
m_rinfo.find(
"URI");
110 boost::filesystem::path rpath (path);
119 return std::unique_ptr<LayerSchema>(ls);
125 return std::unique_ptr<te::da::DataSet>();
134 return std::unique_ptr<te::da::DataSet>();
143 return std::unique_ptr<te::da::DataSet>();
150 return std::unique_ptr<te::da::DataSet>();
157 return std::unique_ptr<te::da::DataSet>();
169 throw Exception((boost::format(
TE_TR(
"Could not draw the data set layer %1%. The renderer type is empty!")) %
getTitle()).str());
173 if(renderer.get() ==
nullptr)
176 renderer->draw(
this, canvas, bbox, srid, scale, cancel);
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
A layer with reference to a raster.
~RasterLayer()
Destructor.
TEMAPEXPORT void CopyAbstractLayerInfo(const te::map::AbstractLayer *refLayer, te::map::AbstractLayer *layer)
Make a copy of refLayer abstract attributes to layer. Creating new id.
std::unique_ptr< LayerSchema > getSchema() const
It returns the layer schema.
This is the base class for layers.
void setRasterInfo(const std::map< std::string, std::string > &rinfo)
virtual const std::string & getTitle() const
It returns the layer title.
A raster band description.
Base exception class for plugin module.
A class that models the description of a dataset.
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:
A layer with reference to a raster.
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. ...
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...
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
BandProperty * getProperty()
Returns the band property.
virtual void setExtent(const te::gm::Envelope &mbr)
It sets the Layer extent (or minimum bounding box).
AbstractLayer * clone()
It returns a clone of the object.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
Grid * getGrid()
It returns the raster grid.
std::map< std::string, std::string > m_rinfo
A raster connection info.
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.
virtual void setSRID(int srid)
It sets the Spatial Reference System ID associated to the Layer.
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.
static const std::string sm_type
A static data member used in the implementation of getType method.
std::string m_rendererType
A pointer to the internal renderer used to paint this layer.
const std::string & getType() const
It returns the layer type: RASTER_LAYER.
A rectified grid is the spatial support for raster data.
void setRendererType(const std::string &t)
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.