14 #include <boost/shared_ptr.hpp> 17 #include <QApplication> 23 std::cout << std::endl <<
"Create LDD Graph..." << std::endl;
26 std::string graphName =
"graphAsu";
29 std::string data_dir = TERRALIB_DATA_DIR;
30 std::unique_ptr<te::rst::Raster> lddRaster =
OpenRaster(data_dir +
"/graph/asu30_dem.tif", 29193);
36 std::string connInfo(
"memory:");
39 std::map<std::string, std::string> graphInfo;
40 graphInfo[
"GRAPH_DATA_SOURCE_TYPE"] =
"MEM";
41 graphInfo[
"GRAPH_NAME"] = graphName;
42 graphInfo[
"GRAPH_DESCRIPTION"] =
"Generated by LDD Builder.";
44 boost::shared_ptr<te::graph::AbstractGraph> graph;
51 if(!builder.
build(lddRaster.get(), connInfo, graphType, graphInfo))
53 std::cout << std::endl <<
"An exception has occurred in Graph Example - CreateLDDGraph: " << builder.
getErrorMessage() << std::endl;
58 catch(
const std::exception& e)
60 std::cout << std::endl <<
"An exception has occurred in Graph Example - CreateLDDGraph: " << e.what() << std::endl;
64 std::cout << std::endl <<
"An unexpected exception has occurred in Graph Example - CreateLDDGraph!" << std::endl;
77 w->
addGraph(graph.get(), *lddRaster->getExtent(), style);
std::unique_ptr< te::rst::Raster > OpenRaster(const std::string &pathName, const int &srid)
Auxiliar functions for load a raster.
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
A Mark specifies a geometric shape and applies coloring to it.
An static class with global definitions for the TerraLib Graph Module.
void CreateLDDGraph(bool draw)
Creates a LDD GRAPH.
A PointSymbolizer specifies the rendering of a graphic Symbolizer at a point.
This file contains include headers for TerraLib Symbology Encoding module.
void push_back(const std::string &semanticTypeIdentifier)
te::se::Style * getLDDGraphStyle()
static const std::string sm_graphFactoryDefaultObject
This definition is used to set the default graph type.
TESEEXPORT LineSymbolizer * CreateLineSymbolizer(Stroke *stroke)
Creates a line symbolizer.
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
void push_back(Symbolizer *s)
std::string getErrorMessage()
Get error message.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
boost::shared_ptr< AbstractGraph > getGraph()
Get generated graph.
This strategy is based on Serio Rosim method, using this "mask" is possible extract a graph from a LD...
The FeatureTypeStyle defines the styling that is to be applied to a dataset that can be viewed as a f...
A simple main window to show example of TerraLib Qt Tools.
void addGraph(te::graph::AbstractGraph *graph, te::gm::Envelope extent, te::se::Style *s=0)
bool build(te::rst::Raster *raster, const std::string &dsInfo, const std::string &graphType, const std::map< std::string, std::string > &gInfo)
Function used to build the output graph based on input parameters.
TESEEXPORT Graphic * CreateGraphic(Mark *mark, const std::string &size, const std::string &rotation, const std::string &opacity)
Creates a graphic.
A Fill specifies the pattern for filling an area geometry.
TESEEXPORT Mark * CreateMark(const std::string &wellKnownName, Stroke *stroke, Fill *fill)
Creates a mark.
TESEEXPORT Stroke * CreateStroke(const std::string &color, const std::string &width)
Creates a stroke.
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
A Stroke specifies the appearance of a linear geometry.
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
This class defines the LDD strategy to build a graph.
A simple main window to show example of TerraLib Graph.
These routines show how to use the Graph module.
TESEEXPORT PointSymbolizer * CreatePointSymbolizer(Graphic *graphic)
Creates a point symbolizer.
TESEEXPORT Fill * CreateFill(const std::string &color, const std::string &opacity)
Creates a fill.