Skip to content
Permalink
Browse files

[OSM] improve import logic of closed ways

  • Loading branch information
nirvn committed Jun 2, 2015
1 parent 0fb0ca8 commit 92b14399b51a6604bce1947f11167ce751c3e2d5
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 92b1439

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