1
0
Fork 0

- Fix a bug in the tile chopper that could lead to infinite recursion for

polygons near the poles.
- Fix a bug in the code that would insert dividing nodes in a long seam which
  could lead to infinite recursion for lines on the poles.
- Change airport area clipping semantics to reduce cracks in scenery.
This commit is contained in:
curt 2005-09-28 16:43:18 +00:00
parent a63f0cfbdf
commit 8524cf7e76
3 changed files with 19 additions and 9 deletions

View file

@ -229,7 +229,9 @@ void tgChopNormalPolygon( const string& path, AreaType area,
// determine horizontal clip line // determine horizontal clip line
SGBucket b_clip = sgBucketOffset(min.x(), min.y(), 0, mid); SGBucket b_clip = sgBucketOffset(min.x(), min.y(), 0, mid);
double clip_line = b_clip.get_center_lat(); double clip_line = b_clip.get_center_lat();
if ( (clip_line >= -89.0) && (clip_line < 89.0) ) { if ( (clip_line >= -90.0 + SG_HALF_BUCKET_SPAN)
&& (clip_line < 90.0 - SG_HALF_BUCKET_SPAN) )
{
clip_line += SG_HALF_BUCKET_SPAN; clip_line += SG_HALF_BUCKET_SPAN;
} else if ( clip_line < -89.0 ) { } else if ( clip_line < -89.0 ) {
clip_line = -89.0; clip_line = -89.0;

View file

@ -38,6 +38,7 @@ SG_USING_STD(string);
enum AreaType { enum AreaType {
SomeSortOfArea = 0, SomeSortOfArea = 0,
HoleArea, // Leave area completely empty HoleArea, // Leave area completely empty
AirportArea,
FreewayArea, FreewayArea,
RoadArea, RoadArea,
RailroadArea, RailroadArea,
@ -53,7 +54,6 @@ enum AreaType {
GlacierArea, // Any solid ice/snow GlacierArea, // Any solid ice/snow
PackIceArea, // Water with ice packs PackIceArea, // Water with ice packs
OceanArea, OceanArea,
AirportArea,
UrbanArea, // Densely-populated city or large town UrbanArea, // Densely-populated city or large town
TownArea, // Small town or village TownArea, // Small town or village
FloodLandArea, // Land subject to flooding FloodLandArea, // Land subject to flooding

View file

@ -498,7 +498,11 @@ TGPolygon tgPolygonSplitLongEdges( const TGPolygon &poly, double max_len ) {
for ( j = 0; j < poly.contour_size(i) - 1; ++j ) { for ( j = 0; j < poly.contour_size(i) - 1; ++j ) {
p0 = poly.get_pt( i, j ); p0 = poly.get_pt( i, j );
p1 = poly.get_pt( i, j + 1 ); p1 = poly.get_pt( i, j + 1 );
// SG_LOG(SG_GENERAL, SG_DEBUG, " " << p0 << " - " << p1);
if ( fabs(p0.y()) < (90.0 - SG_EPSILON)
|| fabs(p1.y()) < (90.0 - SG_EPSILON) )
{
double az1, az2, s; double az1, az2, s;
geo_inverse_wgs_84( 0.0, geo_inverse_wgs_84( 0.0,
p0.y(), p0.x(), p1.y(), p1.x(), p0.y(), p0.x(), p1.y(), p1.x(),
@ -521,6 +525,10 @@ TGPolygon tgPolygonSplitLongEdges( const TGPolygon &poly, double max_len ) {
SG_LOG(SG_GENERAL, SG_DEBUG, p0); SG_LOG(SG_GENERAL, SG_DEBUG, p0);
result.add_node( i, p0 ); result.add_node( i, p0 );
} }
} else {
SG_LOG(SG_GENERAL, SG_DEBUG, p0);
result.add_node( i, p0 );
}
// end of segment is beginning of next segment // end of segment is beginning of next segment
} }