Skip to content

Commit 92b1439

Browse files
committed
[OSM] improve import logic of closed ways
1 parent 0fb0ca8 commit 92b1439

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/analysis/openstreetmap/qgsosmdatabase.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,12 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
471471
continue; // invalid way
472472

473473
bool isArea = ( polyline.first() == polyline.last() ); // closed way?
474-
// some closed ways are not really areas
474+
// filter out closed way that are not areas through tags
475475
if ( isArea && ( t.contains( "highway" ) || t.contains( "barrier" ) ) )
476476
{
477-
if ( t.value( "area" ) != "yes" ) // even though "highway" is line by default, "area"="yes" may override that
477+
// make sure tags that indicate areas are taken into consideration when deciding on a closed way is or isn't an area
478+
// 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
479+
if ( ( t.value( "area" ) != "yes" && !t.contains( "amenity" ) && !t.contains( "landuse" ) && !t.contains( "building" ) && !t.contains( "natural" ) ) || !closed )
478480
isArea = false;
479481
}
480482

0 commit comments

Comments
 (0)