Overpass turbo/Polygon Features
Servers status · Versions · Development · Technical design · Installation · XAPI compatibility layer · Public transport sketch lines · Applications · Source code and issuesOverpass turbo · Wizard · Overpass turbo shortcuts · MapCSS stylesheets · Export to GeoJSON · more · Development · Source code and issues · Web siteOverpass Ultra · Examples · Overpass Ultra extensions · MapLibre stylesheets · URL Params · more · Source code and issues · Web site
As OpenStreetMap doesn't have an intrinsic area data type, an heuristic has to be applied to determine whether a way is a Line or a Polygon. For Overpass turbo and osmtogeojson I came up with the following (see here for a machine-readable JSON file of this table):
A way is considered a Polygon if
- It forms a closed loop, and
- it is not tagged
area=no, and - at least one of the following conditions is true:
- there is a
area=*tag; - there is a
area:highway=*tag and its value is not:no; - there is a
aeroway=*tag and its value is not any of:no, ortaxiway; - there is a
amenity=*tag and its value is not:no; - there is a
barrier=*tag and its value is one of:city_wall,ditch,hedge,retaining_wall,wallorspikes; - there is a
boundary=*tag and its value is not:no; - there is a
building:part=*tag and its value is not:no; - there is a
building=*tag and its value is not:no; - there is a
craft=*tag and its value is not:no; - there is a
golf=*tag and its value is not:no; - there is a
highway=*tag and its value is one of:services,rest_area,escapeorelevator; - there is a
historic=*tag and its value is not:no; - there is a
indoor=*tag and its value is not:no; - there is a
landuse=*tag and its value is not:no; - there is a
leisure=*tag and its value is not:no; - there is a
man_made=*tag and its value is not any of:no,cutline,embankmentnorpipeline; - there is a
military=*tag and its value is not:no; - there is a
natural=*tag and its value is not any of:no,coastline,cliff,ridge,aretenortree_row; - there is a
office=*tag and its value is not:no; - there is a
place=*tag and its value is not:no; - there is a
power=*tag and its value is one of:plant,substation,generatorortransformer; - there is a
public_transport=*tag and its value is not:no; - there is a
railway=*tag and its value is one of:station,turntable,roundhouseorplatform; - there is a
ruins=*tag and its value is not:no; - there is a
shop=*tag and its value is not:no; - there is a
tourism=*tag and its value is not:no; - there is a
waterway=*tag and its value is one of:riverbank,dock,boatyardordam;
- there is a
This is mostly based on the information found in the OSM-wiki (namely the presence and absence of the
/
symbols on the individual key-pages). I used taginfo's wiki database for this task.
Unfortunately, the wiki doesn't include any information about whether or not a tag is categorizing (such as landuse=*) or descriptive (such as name=*). Therefore, this heuristic includes my own understanding and opinion about this. For the same reason, this list is surely quite incomplete! Please inform me about more tags that could imply areas.
