27 #include "../../../dataaccess/dataset/DataSet.h" 28 #include "../../../dataaccess/dataset/DataSetType.h" 29 #include "../../../dataaccess/datasource/DataSource.h" 30 #include "../../../dataaccess/datasource/DataSourceManager.h" 31 #include "../../../dataaccess/datasource/DataSourceTransactor.h" 32 #include "../../../dataaccess/utils/Utils.h" 33 #include "../../../geometry/Envelope.h" 34 #include "../../../geometry/Geometry.h" 35 #include "../../../geometry/GeometryProperty.h" 36 #include "../../../maptools/Utils.h" 37 #include "../../../se/CoverageStyle.h" 38 #include "../../../se/Utils.h" 39 #include "../canvas/Canvas.h" 47 #include <QMessageBox> 48 #include <QResizeEvent> 59 if(ds.get() ==
nullptr)
66 if(dataset->hasRaster())
68 std::unique_ptr<te::da::DataSourceTransactor> t = auxDs->getTransactor();
70 draw(dataset, auxDs, t->getDataSet(dataset->getName()).
get());
76 catch(
const std::exception& e)
78 QMessageBox::warning(
this,
79 tr(
"TerraLib Qt Components"),
84 QMessageBox::warning(
this,
85 tr(
"TerraLib Qt Components"),
86 tr(
"Unknown error when displaying dataset!"));
92 if((dataset.get() ==
nullptr) || (ds.get() ==
nullptr))
98 if(dataset->size() == 0)
101 if(dataset->hasRaster())
105 std::unique_ptr<te::rst::Raster>
rst = datasetData->
getRaster(rpos);
120 int rstSrid = rst->getSRID();
126 else if(dataset->hasGeom())
133 if(mbr.get() ==
nullptr)
136 m_canvas->calcAspectRatio(mbr.get());
138 m_canvas->setWindow(mbr->getLowerLeftX(), mbr->getLowerLeftY(), mbr->getUpperRightX(), mbr->getUpperRightY());
191 if (datasetData->
isNull(gpos))
194 std::unique_ptr<te::gm::Geometry> g(datasetData->
getGeometry(gpos));
202 std::unique_ptr<te::da::DataSet> feature(ds->getDataSet(dataset->getName()));
206 while(feature->moveNext())
208 if (feature->isNull(gpos))
211 std::unique_ptr<te::gm::Geometry> g(feature->getGeometry(gpos));
242 QPainter painter(
this);
244 painter.drawPixmap(0, 0, *(
m_canvas->getPixmap()));
257 m_canvas->resize(e->size().width(), e->size().height());
259 QFrame::resizeEvent(e);
virtual std::unique_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
TEDATAACCESSEXPORT te::gm::Envelope * GetExtent(const std::string &datasetName, const std::string &propertyName, const std::string &datasourceId)
TEDATAACCESSEXPORT void LoadProperties(te::da::DataSetType *dataset, const std::string &datasourceId)
boost::shared_ptr< DataSetType > DataSetTypePtr
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
boost::shared_ptr< DataSource > DataSourcePtr
virtual std::unique_ptr< te::rst::Raster > getRaster(std::size_t i) const =0
Method for retrieving a raster attribute value.
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
TESEEXPORT Style * CreateCoverageStyle(const std::vector< te::rst::BandProperty * > &properties)
Try creates an appropriate coverage style based on given band properties.
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
static te::dt::Date ds(2010, 01, 01)
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
TEMAPEXPORT void DrawRaster(te::da::DataSetType *type, te::da::DataSourcePtr ds, Canvas *canvas, const te::gm::Envelope &bbox, int bboxSRID, const te::gm::Envelope &visibleArea, int srid, te::se::CoverageStyle *style, te::map::RasterContrast *rc, const double &scale, bool *cancel)
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
A dataset is the unit of information manipulated by the data access module of TerraLib.
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
const std::string & getName() const
It returns the property name.