Skip to content

Commit

Permalink
Merge pull request #2100 from nirvn/osm_closed_way_improvement-v2
Browse files Browse the repository at this point in the history
[OSM] improve handling of closed ways
  • Loading branch information
wonder-sk committed Jun 2, 2015
2 parents ae11a73 + 92b1439 commit 4157b33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/analysis/openstreetmap/qgsosmdatabase.cpp
Expand Up @@ -471,10 +471,12 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
continue; // invalid way

bool isArea = ( polyline.first() == polyline.last() ); // closed way?
// some closed ways are not really areas
// filter out closed way that are not areas through tags
if ( isArea && ( t.contains( "highway" ) || t.contains( "barrier" ) ) )
{
if ( t.value( "area" ) != "yes" ) // even though "highway" is line by default, "area"="yes" may override that
// make sure tags that indicate areas are taken into consideration when deciding on a closed way is or isn't an area
// and allow for a closed way to be exported both as a polygon and a line in case both area and non-area tags are present
if ( ( t.value( "area" ) != "yes" && !t.contains( "amenity" ) && !t.contains( "landuse" ) && !t.contains( "building" ) && !t.contains( "natural" ) ) || !closed )
isArea = false;
}

Expand Down

0 comments on commit 4157b33

Please sign in to comment.