- 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
|
// 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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -498,14 +498,18 @@ 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);
|
||||||
|
|
||||||
double az1, az2, s;
|
if ( fabs(p0.y()) < (90.0 - SG_EPSILON)
|
||||||
geo_inverse_wgs_84( 0.0,
|
|| fabs(p1.y()) < (90.0 - SG_EPSILON) )
|
||||||
p0.y(), p0.x(), p1.y(), p1.x(),
|
{
|
||||||
&az1, &az2, &s );
|
double az1, az2, s;
|
||||||
SG_LOG(SG_GENERAL, SG_DEBUG, "distance = " << s);
|
geo_inverse_wgs_84( 0.0,
|
||||||
|
p0.y(), p0.x(), p1.y(), p1.x(),
|
||||||
|
&az1, &az2, &s );
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "distance = " << s);
|
||||||
|
|
||||||
if ( s > max_len ) {
|
if ( s > max_len ) {
|
||||||
int segments = (int)(s / max_len) + 1;
|
int segments = (int)(s / max_len) + 1;
|
||||||
SG_LOG(SG_GENERAL, SG_DEBUG, "segments = " << segments);
|
SG_LOG(SG_GENERAL, SG_DEBUG, "segments = " << segments);
|
||||||
|
|
||||||
|
@ -517,9 +521,13 @@ TGPolygon tgPolygonSplitLongEdges( const TGPolygon &poly, double max_len ) {
|
||||||
SG_LOG(SG_GENERAL, SG_DEBUG, tmp);
|
SG_LOG(SG_GENERAL, SG_DEBUG, tmp);
|
||||||
result.add_node( i, tmp );
|
result.add_node( i, tmp );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue