1
0
Fork 0

fixes for Martin's tiles that don't clip correctly

- ogrdecode can create degenerate polys.  clean them before clipping
- when tesselating with extra points, add constrain pointes and segments
  before non contrained points.
This commit is contained in:
Peter Sadrozinski 2015-06-10 07:11:09 -04:00
parent 87fe67d5fc
commit 968089d322
2 changed files with 7 additions and 2 deletions

View file

@ -112,6 +112,9 @@ int TGConstruct::LoadLandclassPolys( void ) {
}
/* make sure we loaded a valid poly */
poly = tgPolygon::RemoveDups(poly);
poly = tgPolygon::RemoveCycles(poly);
poly = tgPolygon::RemoveDups(poly);
poly = tgPolygon::RemoveBadContours(poly);
if ( poly.Contours() ) {
polys_in.add_poly( area, poly );

View file

@ -114,8 +114,6 @@ void tgPolygon::Tesselate( const std::vector<SGGeod>& extra )
points.push_back( Point(extra[n].getLongitudeDeg(), extra[n].getLatitudeDeg() ) );
}
cdt.insert(points.begin(), points.end());
// then insert each polygon as a constraint into the triangulation
for ( unsigned int c = 0; c < contours.size(); c++ ) {
tgContour contour = contours[c];
@ -129,6 +127,10 @@ void tgPolygon::Tesselate( const std::vector<SGGeod>& extra )
tg_insert_polygon(cdt, poly);
}
if ( !points.empty() ) {
cdt.insert(points.begin(), points.end());
}
/* make conforming - still has an issue, and can't be compiled with exact_construction kernel */
// CGAL::make_conforming_Delaunay_2( cdt );