27 #include "../core/translator/Translator.h" 28 #include "../dataaccess/utils/Utils.h" 29 #include "../maptools/AbstractRenderer.h" 30 #include "../maptools/RendererFactory.h" 35 #include <boost/format.hpp> 36 #include <boost/lexical_cast.hpp> 41 :
te::map::AbstractLayer(parent),
42 m_rendererType(
"WMS_LAYER_RENDERER"),
61 const std::string& title,
79 return std::auto_ptr<te::map::LayerSchema>(static_cast<te::map::LayerSchema*>(
m_schema->clone()));
97 return ds->getDataSet(request, travType, accessPolicy);
110 return ds->getDataSet(request, propertyName, e, r, travType, accessPolicy);
123 return ds->getDataSet(request, propertyName, g, r, travType, accessPolicy);
130 throw Exception(
TE_TR(
"Query operations are not supported by the WMS Layer!"));
137 throw Exception(
TE_TR(
"The ObjectIdSet concept is not supported by the WMS Layer!"));
158 if(ds.get() == 0 || !ds->isValid() || !ds->isOpened())
167 throw Exception((boost::format(
TE_TR(
"Could not draw the WMS layer %1%. The renderer type is empty!")) %
getTitle()).str());
171 if(renderer.get() == 0)
174 renderer->draw(
this, canvas, bbox, srid, scale, cancel);
235 request +=
"&WIDTH=" + boost::lexical_cast<std::string>(
m_width);
236 request +=
"&HEIGHT=" + boost::lexical_cast<std::string>(
m_height);
TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string &datasourceId, const bool opened=true)
Search for a data source with the informed id in the DataSourceManager.
void setDataSourceId(const std::string &id)
std::auto_ptr< te::map::LayerSchema > getSchema() const
It returns the layer schema.
This is the base class for layers.
boost::shared_ptr< DataSource > DataSourcePtr
virtual const std::string & getTitle() const
It returns the layer title.
This XML Schema Document named xlinks xsd has been stored here based on the change request
Base exception class for plugin module.
A class that models the description of a dataset.
std::string m_datasetName
The dataset name where we will retrieve the layer data.
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.
void setFormat(const std::string &format)
const std::string & getType() const
It returns the layer type.
SpatialRelation
Spatial relations between geometric objects.
const std::string & getDataSetName() const
std::size_t m_width
Width that will be requested.
std::string m_format
Format that will be requested.
std::size_t m_height
Height that will be requested.
static te::dt::Date ds(2010, 01, 01)
void setDataSetName(const std::string &name)
#define TE_TR(message)
It marks a string in order to get translated.
#define TE_WMS_DEFAULT_IMAGE_FORMAT
It specifies the default image format used on GetMap request.
static const std::string sm_type
A static data member used in the implementation of getType method.
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:
const std::string & getDataSourceId() const
WMSLayer(te::map::AbstractLayer *parent=0)
It initializes a new layer.
#define TE_WMS_DEFAULT_HEIGHT
It specifies the default height used on GetMap request.
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...
void setWidth(const std::size_t &width)
void draw(te::map::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. ...
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.
std::string buildRequest() const
A canvas is an abstraction of a drawing area.
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
#define TE_WMS_DEFAULT_WIDTH
It specifies the default width used on GetMap request.
AbstractLayer(AbstractLayer *parent=0)
It initializes a new layer.
std::auto_ptr< te::map::LayerSchema > m_schema
The WMS layer schema.
std::string m_rendererType
A pointer to the internal renderer used to paint this layer.
std::string m_datasourceId
The DataSource associated to this layer.
void setRendererType(const std::string &t)
void setHeight(const std::size_t &height)