49 #include <boost/algorithm/string.hpp> 50 #include <boost/filesystem.hpp> 51 #include <boost/lexical_cast.hpp> 52 #include <boost/uuid/random_generator.hpp> 53 #include <boost/uuid/uuid_io.hpp> 57 #include <QActionGroup> 92 connect(coordTracking, SIGNAL(coordTracked(QPointF&)), SLOT(
onCoordTracked(QPointF&)));
93 m_display->installEventFilter(coordTracking);
96 setWindowTitle(tr(
"TerraLib Graph Example"));
97 setMinimumSize(60, 60);
108 m_setPan =
new QAction(tr(
"Pan"),
this);
118 m_png =
new QAction(tr(
"PNG"),
this);
119 m_png->setCheckable(
false);
123 QActionGroup* toolsGroup =
new QActionGroup(
this);
204 std::string connInfo (
"file://" + path);
210 boost::uuids::basic_random_generator<boost::mt19937> gen;
211 boost::uuids::uuid u = gen();
212 std::string
id = boost::uuids::to_string(u);
215 dsInfo->setConnInfo(connInfo);
216 dsInfo->setTitle(
"DS");
217 dsInfo->setAccessDriver(
"OGR");
218 dsInfo->setType(
"OGR");
219 dsInfo->setDescription(
"");
225 std::vector<std::string> datasets = ds->getDataSetNames();
228 std::string dsName = datasets[0];
229 std::unique_ptr<te::da::DataSetType>
dt = ds->getDataSetType(dsName);
232 std::unique_ptr<te::da::DataSet> dataSet = ds->getDataSet(dsName);
238 std::unique_ptr<te::gm::Envelope> extent = dataSet->getExtent(geomPos);
295 fileName.append(count);
296 fileName.append(
".png");
305 QString text = QString::fromUtf8(
"Coordinates: (") + QString::number(coordinate.x()) +
" , " + QString::number(coordinate.y()) +
")";
306 QStatusBar* sb = statusBar();
307 sb->showMessage(text);
std::list< te::map::AbstractLayerPtr > m_layers
void setGraph(te::graph::AbstractGraph *ds)
It sets the graph associated to the layer.
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
virtual void setDataSourceId(const std::string &id)
This class implements a concrete tool to geographic zoom operation using the mouse wheel...
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
void setDataSetName(const std::string &name)
void setSRID(int srid)
It sets the Spatial Reference System ID associated to the Layer.
This file contains include headers for TerraLib Symbology Encoding module.
void push_back(const std::string &semanticTypeIdentifier)
static te::dt::Date ds(2010, 01, 01)
void push_back(Symbolizer *s)
This class implements a concrete tool to geographic zoom in operation using a boundary rectangle...
This class implements a concrete tool to measure operation (distance, area, and angle).
It renders the objects associated to a Layer.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
void setRendererType(const std::string &t)
virtual te::graph::GraphMetadata * getMetadata()=0
Function used to access the graph metadata.
virtual void setLayerList(const std::list< te::map::AbstractLayerPtr > &layers)
It sets the layer list to be showed in the Map Display.
TEDATAACCESSEXPORT std::size_t GetFirstSpatialPropertyPos(const te::da::DataSet *dataset)
It returns the first dataset spatial property or NULL if none is found.
~DisplayWindow()
Destructor.
static DataSourceInfoManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
The FeatureTypeStyle defines the styling that is to be applied to a dataset that can be viewed as a f...
This class implements a concrete tool to geographic coordinate tracking on mouse move operation...
Abstract class used to define the main functions of graph struct. All graph implementations must used...
void addGraph(te::graph::AbstractGraph *graph, te::gm::Envelope extent, te::se::Style *s=0)
static te::dt::TimeDuration dt(20, 30, 50, 11)
virtual void setVisibility(Visibility v)
It sets the layer visibility.
te::qt::widgets::AbstractTool * m_tool
virtual void setExtent(const te::gm::Envelope &mbr)
It sets the Layer extent (or minimum bounding box).
void setRenderer(LayerRenderer *renderer)
It sets the renderer used to paint this layer.
This class implements a concrete tool to geographic pan operation.
void onZoomAreaTriggered()
void addVectorialLayer(std::string path, int srid)
TESEEXPORT Stroke * CreateStroke(const std::string &color, const std::string &width)
Creates a stroke.
It renders the objects associated to a Layer.
DisplayWindow(QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
void onCoordTracked(QPointF &coordinate)
void setStroke(Stroke *stroke)
A Stroke specifies the appearance of a linear geometry.
virtual void setStyle(te::se::Style *style)
It sets the Style associated to the layer.
A class that represents a data source component.
This file contains include headers for the TerraLib Common Runtime module.
void addRasterLayer(std::string path, std::string name)
virtual int getSRID() const
It returns the Spatial Reference System ID associated to the Layer.
A simple main window to show example of TerraLib Graph.
A layer with reference to a dataset.
void setFill(Fill *f)
A Fill specifies the pattern for filling an area geometry.
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.
These routines show how to use the Graph module.
This file contains include headers for the Data Access module of TerraLib.
te::qt::widgets::MapDisplay * m_display
A Layer is a reference to a virtual dataset with/without geometric attributes.
void setPNGPrefix(std::string prefix)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
TESEEXPORT Fill * CreateFill(const std::string &color, const std::string &opacity)
Creates a fill.