OSM tags indicate if a closed way should be treated as a polygon or linestring
github.com/tyrasd/osm-polygon-features
tyrasd/osm-polygon-features