18 #include <QApplication> 28 std::string connInfo (
"file://");
29 connInfo += TERRALIB_DATA_DIR
"/shape/munic_2001.shp";
35 std::vector<std::string> datasets = datasource->getDataSetNames();
44 std::map<te::gm::GeomType, te::se::Style*> styles;
51 std::list<te::map::AbstractLayerPtr> layerList;
52 for(
unsigned int i = 0; i < datasets.size(); ++i)
54 std::unique_ptr<te::da::DataSetType>
dt(datasource->getDataSetType(datasets[i]));
63 std::unique_ptr<te::gm::Envelope> e(datasource->getExtent(datasets[i], geomProperty->
getName()));
75 layerList.push_back(layer);
78 mapDisplay->setMinimumSize(QSize(60, 60));
80 mapDisplay->setLayerList(layerList);
82 mapDisplay->setExtent(env);
88 catch(
const std::exception& e)
90 std::cout << std::endl <<
"An exception has occurred in DrawLayer example: " << e.what() << std::endl;
94 std::cout << std::endl <<
"An unexpected exception has occurred in DrawLayer example!" << std::endl;
virtual void setDataSourceId(const std::string &id)
boost::shared_ptr< DataSource > DataSourcePtr
void setDataSetName(const std::string &name)
A multi thread Qt4 widget to control the display of a set of layers.
void Union(const Envelope &rhs)
It updates the envelop with coordinates of another envelope.
void setRendererType(const std::string &t)
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.
static te::dt::TimeDuration dt(20, 30, 50, 11)
virtual void setVisibility(Visibility v)
It sets the layer visibility.
virtual void setExtent(const te::gm::Envelope &mbr)
It sets the Layer extent (or minimum bounding box).
virtual void setStyle(te::se::Style *style)
It sets the Style associated to the layer.
This file contains include headers for the TerraLib Common Runtime module.
A layer with reference to a dataset.
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.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
This file contains include headers for the Data Access module of TerraLib.
const std::string & getName() const
It returns the property name.