20 #include <QApplication> 29 std::string connInfo(
"file://" + path);
35 std::vector<std::string> datasets = datasource->getDataSetNames();
36 assert(!datasets.empty());
39 std::string dataSetName(datasets[0]);
40 std::unique_ptr<te::da::DataSet>
ds(datasource->getDataSet(dataSetName));
43 std::unique_ptr<te::rst::Raster> raster(
ds->getRaster(rpos));
49 layer->setDataSourceId(datasource->getId());
50 layer->setDataSetName(dataSetName);
51 layer->setExtent(extent);
52 layer->setRendererType(
"ABSTRACT_LAYER_RENDERER");
53 layer->setSRID(raster->getSRID());
64 if(srid != raster->getSRID())
65 extent.transform(raster->getSRID(), srid);
67 double llx = extent.m_llx;
68 double lly = extent.m_lly;
69 double urx = extent.m_urx;
70 double ury = extent.m_ury;
85 dialog.setWindowTitle(fileName.c_str());
86 dialog.setFixedSize(pixmap->size());
88 QLabel preview(&dialog);
89 preview.setPixmap(*pixmap);
146 l->
draw(c, *e, srid, 0, &cancel);
148 paint(c, generatePNG,
"RGB_012_Style");
191 l->
draw(c, *e, srid, 0, &cancel);
193 paint(c, generatePNG,
"RGB_012_Transp_Style");
236 l->
draw(c, *e, srid, 0, &cancel);
238 paint(c, generatePNG,
"RGB_102_Style");
285 l->
draw(c, *e, srid, 0, &cancel);
287 paint(c, generatePNG,
"RGB_012_G_Contrast_Style");
342 l->
draw(c, *e, srid, 0, &cancel);
344 paint(c, generatePNG,
"RGB_012_RGB_Contrast_Style");
377 l->
draw(c, *e, srid, 0, &cancel);
379 paint(c, generatePNG,
"MONO_0_Style");
412 l->
draw(c, *e, srid, 0, &cancel);
414 paint(c, generatePNG,
"MONO_2_Style");
447 l->
draw(c, *e, srid, 0, &cancel);
449 paint(c, generatePNG,
"RED_Style");
461 std::unique_ptr<te::map::DataSetLayer> rasterLayer(
CreateRasterLayer(TERRALIB_DATA_DIR
"/rasters/cbers2b_rgb342_crop.tif"));
468 int srid = raster->getSRID();
498 catch(
const std::exception& e)
500 std::cout << std::endl <<
"An exception has occurred in Styling example: " << e.what() << std::endl;
504 std::cout << std::endl <<
"An unexpected exception has occurred in Styling example!" << std::endl;
void setRedChannel(SelectedChannel *c)
A selected channel to be display.
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
virtual const te::gm::Envelope & getExtent() const
It returns the Layer extent (or minimum bounding box).
boost::shared_ptr< DataSource > DataSourcePtr
void MONO_2_Style(te::qt::widgets::Canvas *c, te::map::DataSetLayer *l, te::gm::Envelope *e, int srid)
void RGB_102_Style(te::qt::widgets::Canvas *c, te::map::DataSetLayer *l, te::gm::Envelope *e, int srid)
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
void RGB_012_Transp_Style(te::qt::widgets::Canvas *c, te::map::DataSetLayer *l, te::gm::Envelope *e, int srid)
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
This file contains include headers for TerraLib Symbology Encoding module.
void push_back(const std::string &semanticTypeIdentifier)
void setGammaValue(const double &v)
void setGrayChannel(SelectedChannel *c)
static te::dt::Date ds(2010, 01, 01)
void RGB_012_G_Contrast_Style(te::qt::widgets::Canvas *c, te::map::DataSetLayer *l, te::gm::Envelope *e, int srid)
void push_back(Symbolizer *s)
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
void MONO_0_Style(te::qt::widgets::Canvas *c, te::map::DataSetLayer *l, te::gm::Envelope *e, int srid)
te::map::DataSetLayer * CreateRasterLayer(const std::string &path)
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
te::qt::widgets::Canvas * CreateCanvas(te::map::DataSetLayer *layer, te::gm::Envelope *e, int srid)
void setColorCompositionType(ColorCompositionType cct)
ContrastEnhancement defines the 'stretching' of contrast for a channel of a false-color image or for ...
void setChannelSelection(ChannelSelection *c)
void RED_Style(te::qt::widgets::Canvas *c, te::map::DataSetLayer *l, te::gm::Envelope *e, int srid)
void RGB_012_RGB_Contrast_Style(te::qt::widgets::Canvas *c, te::map::DataSetLayer *l, te::gm::Envelope *e, int srid)
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
void setOpacity(ParameterValue *p)
TEMAPEXPORT te::rst::Raster * GetRaster(AbstractLayer *layer)
It gets the raster referenced by the given data set layer.
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
virtual void setStyle(te::se::Style *style)
It sets the Style associated to the layer.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
void setContrastEnhancement(ContrastEnhancement *c)
void setSourceChannelName(const std::string &name)
This file contains include headers for the TerraLib Common Runtime module.
void DrawRasterStyledLayers()
It draws a set of raster layers using styles encoded using OGC RasterSymbology Enconding specificatio...
A layer with reference to a dataset.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
This file contains include headers for the Vector Geometry model of TerraLib.
This file contains include headers for the Data Access module of TerraLib.
void setBlueChannel(SelectedChannel *c)
void RGB_012_Style(te::qt::widgets::Canvas *c, te::map::DataSetLayer *l, te::gm::Envelope *e, int srid)
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. ...
void showPixmap(te::qt::widgets::Canvas *c, std::string fileName)
void setGreenChannel(SelectedChannel *c)
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...
void paint(te::qt::widgets::Canvas *c, bool generatePNG, std::string fileName)