Advertisement
Guest User

Geos Cascaded Union

a guest
Jan 23rd, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. std::vector<geos::geom::Polygon*> geomCollection;
  2.  
  3.   QList<FeatureLayer>::ConstIterator FeatureListEnd = mFeatureList1.end();
  4.   for ( it = mFeatureList1.begin(); it != FeatureListEnd; ++it )
  5.   {
  6.     g1 = it->feature.geometry();
  7.     const std::string wkt = g1->exportToWkt().toStdString();
  8.     geos::geom::Polygon* geom =  dynamic_cast<geos::geom::Polygon*>(geos::io::WKTReader().read(wkt)); //error is here....
  9.     geomCollection.push_back(geom);
  10.   }
  11.  
  12.   geos::geom::Geometry* unionedPoly = geos::operation::geounion::CascadedPolygonUnion::Union(&geomCollection);
  13.  
  14.  
  15. Error
  16. /home/vinayan/QgisGitWorking/Quantum-GIS/src/plugins/topology/topolTest.cpp:746: error: cannot dynamic_cast ‘geos::io::WKTReader().geos::io::WKTReader::read((* & wkt))(of type ‘struct geos::geom::Geometry*) to type ‘struct geos::geom::Polygon*(target is not pointer or reference to complete type)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement