ߏߔߌ߲ߛߑߕߙߌߕߑߡߊߔ ߛߌ߲ߞߐ߲ OpenStreetMap

Quick and dirty OSM statistics with bash and jq

ߊ߬ ߟߊߦߟߍ߬ߣߍ߲߬ ߦߋ߫ pangoSE ߓߟߏ߫ 10 January 2020 ߦߋ߫ English ߟߋ߬ ߘߐ߫ ߟߊ߬ߞߎ߬ߘߦߊ߬ߟߌ߬ ߞߐߟߕߊ 11 January 2020 ߘߐ߫

This is the script I came up with to make some stats on the huts and shelters of Sweden. The data was fetched via overpass-turbo.

download the geojson from Overpass Turbo -> export or save as from JOSM.

example query: access!=private and (tourism=alpine_hut or tourism=wilderness_hut or (amenity=shelter and shelter_type!=public_transport)) in sweden

you can run this query from inside JOSM - see the JOSM wiki.

The script is here: https://gist.github.com/pangoSE/5294e835c9bead773e8036603a90b898

This was the output for Sweden:

$ ./stats.sh vin-190110.geojson 
Numbers of each type:
Shelters - total: 2629
Shelters - Lean to (sv. vindskydd): 793
Shelters - Basic hut (sv. stuga utan uppvärmning): 129
Shelters - Weather shelter (sv. väderskydd endast lämpad för kort uppehåll vid dåligt väder): 355
Shelters - Picnic shelter (sv. liten byggnad med tak, eldstad och skorsten i mitten): 251
Shelters - Unknown type: 1692
Wilderness huts: 43
Alpine huts: 82

Lean_to shelters details:
- has description tag: 29 - 3%
- has fireplace=yes: 305 - 38%
- has floor=wood: 7 - 0%
- has image: 18 - 2%
- has snowmobile=yes: 28 - 3%
- has water_source tag: 4 - 0%
- has wood_provided=yes: 3 - 0%

Basic huts details:
- has description tag: 16 - 12%
- has fireplace=yes: 52 - 40%
- has image: 1 - 0%
- has snowmobile=yes: 18 - 13%
- has water_source tag: 0 - 0%
- has wood_provided=yes: 0 - 0%

Wilderness huts details:
- has description tag: 18 - 41%
- has fireplace=yes: 41 - 95%
- has image: 5 - 11%
- has snowmobile=yes: 18 - 41%
- has water_source tag: 0 - 0%
- has wood_provided=yes: 0 - 0%

Alpine huts details:
- has description tag: 12 - 14%
- has fireplace=yes: 4 - 4%
- has image: 5 - 6%
- has snowmobile=yes: 19 - 23%
- has water_source tag: 2 - 2%
- has wood_provided=yes: 5 - 6%
Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ mmd ߟߊ߫ 11 January 2020 at 21:12 ߘߐ߫

You can probably generate the same output with a single Overpass query without any external shell script. Check out osm.wiki/Overpass_API/Overpass_API_by_Example#Wiki_table_generator_.28since_0.7.54.29 for some ideas.

ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ pangoSE ߟߊ߫ 12 January 2020 at 13:34 ߘߐ߫

thanks for the tip!

ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ pangoSE ߟߊ߫ 12 January 2020 at 13:36 ߘߐ߫

@mmd can it also calculate the percentages?

ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ mmd ߟߊ߫ 12 January 2020 at 14:05 ߘߐ߫

ߌ ߜߊ߲߬ߞߎ߲߫ ߞߊ߬ ߛߋ߫ ߡߙߌߣߊ߲ ߦߌ߬ߘߊ߬ ߟߊ߫