16 std::cout <<
"This example shows how to use the vectorization method." << std::endl << std::endl;
19 std::map<std::string, std::string> rinfo;
20 rinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/pattern1.tif";
23 std::vector<te::gm::Geometry*> polygons;
26 std::cout <<
"vectorizer created " << polygons.size() <<
" polygons" << std::endl;
27 for (
unsigned int i = 0; i < polygons.size(); i++)
30 std::cout << i <<
": " << polygon->
toString() << std::endl;
37 std::cout <<
"Done!" << std::endl << std::endl;
39 catch(
const std::exception& e)
41 std::cout << std::endl <<
"An exception has occurred in VectorizeRaster(): " << e.what() << std::endl;
45 std::cout << std::endl <<
"An unexpected exception has occurred in VectorizeRaster()!" << std::endl;
virtual void vectorize(std::vector< te::gm::Geometry * > &g, std::size_t b, unsigned int mp=0, std::vector< double > *const polygonsValues=0)
Vectorizes a given raster band, using GDALPolygonize function.
void VectorizeRaster()
This example shows how to use the vectorization method.
An abstract class for raster data strucutures.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
These routines show how to use the raster module and the GDAL data source module. ...
std::string toString() const
It returns the data value in a WKT representation.
This file contains include headers for the Vector Geometry model of TerraLib.
This file contains include headers for the Data Access module of TerraLib.
static Raster * open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
It opens a raster with the given parameters and default raster driver.