- 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:
parent
a63f0cfbdf
commit
8524cf7e76
3 changed files with 19 additions and 9 deletions
|
@ -229,7 +229,9 @@ void tgChopNormalPolygon( const string& path, AreaType area,
|
|||
// determine horizontal clip line
|
||||
SGBucket b_clip = sgBucketOffset(min.x(), min.y(), 0, mid);
|
||||
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;
|
||||
} else if ( clip_line < -89.0 ) {
|
||||
clip_line = -89.0;
|
||||
|
|
|
@ -38,6 +38,7 @@ SG_USING_STD(string);
|
|||
enum AreaType {
|
||||
SomeSortOfArea = 0,
|
||||
HoleArea, // Leave area completely empty
|
||||
AirportArea,
|
||||
FreewayArea,
|
||||
RoadArea,
|
||||
RailroadArea,
|
||||
|
@ -53,7 +54,6 @@ enum AreaType {
|
|||
GlacierArea, // Any solid ice/snow
|
||||
PackIceArea, // Water with ice packs
|
||||
OceanArea,
|
||||
AirportArea,
|
||||
UrbanArea, // Densely-populated city or large town
|
||||
TownArea, // Small town or village
|
||||
FloodLandArea, // Land subject to flooding
|
||||
|
|
|
@ -498,7 +498,11 @@ TGPolygon tgPolygonSplitLongEdges( const TGPolygon &poly, double max_len ) {
|
|||
for ( j = 0; j < poly.contour_size(i) - 1; ++j ) {
|
||||
p0 = poly.get_pt( i, j );
|
||||
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;
|
||||
geo_inverse_wgs_84( 0.0,
|
||||
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);
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue