4 #include "../../Config.h" 14 #include <QApplication> 24 std::string data_dir = TERRALIB_DATA_DIR;
26 std::string connInfo (
"file://");
27 connInfo += data_dir +
"/shape/munic_2001.shp";
32 std::unique_ptr<te::da::DataSourceTransactor> t = dsOGR->getTransactor();
34 std::unique_ptr<te::da::DataSetType>
dt = (dsOGR->getDataSetType(
"munic_2001"));
35 std::unique_ptr<te::da::DataSet> dataset = t->getDataSet(
"munic_2001");
37 std::unique_ptr<te::gm::Envelope> extent = dataset->getExtent(pos);
41 throw(
"Extent not loaded!");
46 double llx = extent->m_llx;
47 double lly = extent->m_lly;
48 double urx = extent->m_urx;
49 double ury = extent->m_ury;
71 while(dataset->moveNext())
73 std::unique_ptr<te::gm::Geometry> g = dataset->getGeometry(geomName);
77 std::string fileName = dt->getName() +
".png";
80 catch(
const std::exception& e)
82 std::cout << std::endl <<
"An exception has occurred in drawPNG example: " << e.what() << std::endl;
86 std::cout << std::endl <<
"An unexpected exception has occurred in drawPNG example!" << std::endl;
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
Several examples declarations.
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
static te::dt::TimeDuration dt(20, 30, 50, 11)
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
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.
void DrawPNG()
It retrieves data from a Shape-file and prints it to a png graphics file.