Skip to content
Permalink
Browse files

Merge pull request #2100 from nirvn/osm_closed_way_improvement-v2

[OSM] improve handling of closed ways
  • Loading branch information
wonder-sk committed Jun 2, 2015
2 parents ae11a73 + 92b1439 commit 4157b33875c00555e8bcca5fedbf8af71b17ba9f
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/analysis/openstreetmap/qgsosmdatabase.cpp
@@ -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;
}

0 comments on commit 4157b33

Please sign in to comment.
You can’t perform that action at this time.