From 3a83772a09e48353f8455856aa5a19f27236d3b1 Mon Sep 17 00:00:00 2001 From: Ralf Gerlich Date: Tue, 19 Jan 2010 19:39:28 +0100 Subject: [PATCH] The island mask should actually contain islands, not water. --- src/BuildTiles/Clipper/clipper.cxx | 2 +- src/BuildTiles/Clipper/priorities.cxx | 8 +++++++- src/BuildTiles/Clipper/priorities.hxx | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/BuildTiles/Clipper/clipper.cxx b/src/BuildTiles/Clipper/clipper.cxx index 73a677eb..36cadecc 100644 --- a/src/BuildTiles/Clipper/clipper.cxx +++ b/src/BuildTiles/Clipper/clipper.cxx @@ -471,7 +471,7 @@ bool TGClipper::clip_all(const point2d& min, const point2d& max) { water_mask = tgPolygonUnion( water_mask, polys_in.polys[i][j] ); } - } else if ( is_water_area( i ) ) { + } else if ( is_island_area( i ) ) { for (unsigned int j = 0; j < polys_in.polys[i].size(); j++) { island_mask = tgPolygonUnion( island_mask, polys_in.polys[i][j] ); diff --git a/src/BuildTiles/Clipper/priorities.cxx b/src/BuildTiles/Clipper/priorities.cxx index 2face93c..f3189ef9 100644 --- a/src/BuildTiles/Clipper/priorities.cxx +++ b/src/BuildTiles/Clipper/priorities.cxx @@ -149,7 +149,13 @@ bool is_water_area( AreaType area ) { } bool is_landmass_area( AreaType area ) { - return get_area_descriptor( area ).kind==Landmass; + const AreaKind kind = get_area_descriptor( area ).kind; + return (kind==Landmass); +} + +bool is_island_area( AreaType area ) { + const AreaKind kind = get_area_descriptor( area ).kind; + return (kind==Island); } bool is_lake_area( AreaType area ) { diff --git a/src/BuildTiles/Clipper/priorities.hxx b/src/BuildTiles/Clipper/priorities.hxx index 7c8c570f..7d1bc9db 100644 --- a/src/BuildTiles/Clipper/priorities.hxx +++ b/src/BuildTiles/Clipper/priorities.hxx @@ -33,6 +33,7 @@ typedef unsigned int AreaType; int load_area_types( const std::string& filename ); bool is_hole_area(AreaType areaType); bool is_landmass_area(AreaType areaType); +bool is_island_area(AreaType areaType); bool is_water_area(AreaType areaType); bool is_lake_area(AreaType areaType); bool is_stream_area(AreaType areaType);