Skip to content

Commit

Permalink
[OSM] improve import logic of closed ways
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jun 2, 2015
1 parent 0fb0ca8 commit 92b1439
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 92b1439

Please sign in to comment.