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:
parent
87fe67d5fc
commit
968089d322
2 changed files with 7 additions and 2 deletions
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue