Skip to content

Education tags: Improve handling of building presets #1632

@tordans

Description

@tordans

While testing #1472 I noticed that we have problem with our "College Building" preset https://github.com/openstreetmap/id-tagging-schema/blob/main/data/presets/building/college.json#L13-L15

The idea is, that we have to presets for this educational data

  • one for the "College Grounds" (see PR)
  • one for the "College Building"

However, the College Building Preset only triggers when building=college. Which means that for cases like https://ideditor.netlify.app/#locale=en&disable_features=boundaries&map=20.00/48.28871/6.96602&background=Bing&id=w44116127 (https://www.openstreetmap.org/way/44116127) where building=yes is used, the "* Grounds" Preset is used instead of the "* Building" preset.

I looked at the College example but we have this kind of setup other features; I assume alle educational presets.


I looked into some data to see how the building tags are used for those amenities. Below is some data.

What to do…

My take is, that we should look for a way to improve the matching of the "* Building" matching.
Ideas:

  • Use the deprecation rules to rewrite building=yes to building=college when building=yes is combined with amenity=college or education=college
  • Add more hidden presets that match the building=yes (etc) cases and use addTags to rewrite them
  • Expand the schema to allow for matching of OR values: Trigger on both, yes and college (That would not rewrite, though)

Overview building values for educational amenties

We see, that building=yes, house, public are all used a lot.

Query
curl -g https://postpass.geofabrik.de/api/0.2/interpreter \
--data-urlencode "options[geojson]=false" \
--data-urlencode "data=
SELECT tags->>'building' AS building, COUNT(*) AS count
FROM postpass_pointpolygon
WHERE tags->>'amenity' IN (
  'college',
  'dancing_school',
  'driving_school',
  'kindergarten',
  'language_school',
  'music_school',
  'prep_school',
  'school',
  'university'
) AND tags ? 'building'
GROUP BY tags->>'building'
ORDER BY count DESC"
97710, "yes"
40594, "school"
10362, "kindergarten"
2726, "university"
1530, "civic"
1416, "house"
1320, "college"
749, "public"
738, "commercial"
643, "residential"
422, "no"
301, "apartments"
289, "office"
225, "retail"
137, "detached"
130, "government"
101, "church"
100, "industrial"
90, "dormitory"
78, "construction"
77, "roof"
68, "education"
50, "building_concrete"
48, "hospital"
42, "warehouse"
41, "service"
32, "sports_hall"
28, "toilets"
27, "terrace"
24, "garage"
21, "container"
20, "shed"
18, "hut"
17, "sports_centre"
17, "semidetached_house"
17, "cultural"
16, "mosque"
14, "religious"
13, "static_caravan"
12, "school;yes"
11, "commercial;residential"
10, "building_sheet_metal"
10, "amenity"
8, "ruins"
7, "abandoned"
7, "music_school"
7, "educacional"
7, "preschool"
6, "utility"
6, "farm_auxiliary"
6, "greenhouse"
6, "hotel"
5, "public_building"
5, "train_station"
5, "castle"
5, "cabin"
5, "bridge"
5, "yes;school"
5, "chapel"
5, "childcare"
5, "collapsed"

Detailed data per amenity type

Query
curl -g https://postpass.geofabrik.de/api/0.2/interpreter \
--data-urlencode "options[geojson]=false" \
--data-urlencode "data=
SELECT
  tags->>'amenity' AS amenity,
  tags->>'building' AS building,
  COUNT(*) AS count
FROM postpass_pointpolygon
WHERE tags->>'amenity' IN (
  'college',
  'dancing_school',
  'driving_school',
  'kindergarten',
  'language_school',
  'music_school',
  'prep_school',
  'school',
  'university'
) AND tags ? 'building'
GROUP BY tags->>'amenity', tags->>'building'
HAVING COUNT(*) > 10
ORDER BY count DESC"
Result…
count, amenity-value, building tag
"college", "building=apartments", 15
"college", "building=civic", 88
"college", "building=college", 1178
"college", "building=commercial", 53
"college", "building=dormitory", 16
"college", "building=house", 44
"college", "building=industrial", 17
"college", "building=office", 51
"college", "building=public", 67
"college", "building=residential", 23
"college", "building=school", 1242
"college", "building=university", 268
"college", "building=yes", 4974
"dancing_school", "building=commercial", 28
"dancing_school", "building=retail", 12
"dancing_school", "building=school", 14
"dancing_school", "building=yes", 225
"driving_school", "building=apartments", 36
"driving_school", "building=commercial", 117
"driving_school", "building=house", 97
"driving_school", "building=no", 37
"driving_school", "building=office", 20
"driving_school", "building=residential", 30
"driving_school", "building=retail", 46
"driving_school", "building=school", 77
"driving_school", "building=yes", 2836
"kindergarten", "building=apartments", 113
"kindergarten", "building=church", 16
"kindergarten", "building=civic", 522
"kindergarten", "building=commercial", 217
"kindergarten", "building=construction", 13
"kindergarten", "building=container", 13
"kindergarten", "building=detached", 84
"kindergarten", "building=education", 28
"kindergarten", "building=house", 597
"kindergarten", "building=industrial", 15
"kindergarten", "building=kindergarten", 10207
"kindergarten", "building=no", 28
"kindergarten", "building=office", 18
"kindergarten", "building=public", 220
"kindergarten", "building=residential", 185
"kindergarten", "building=retail", 65
"kindergarten", "building=school", 1959
"kindergarten", "building=static_caravan", 12
"kindergarten", "building=terrace", 14
"kindergarten", "building=university", 19
"kindergarten", "building=yes", 21650
"language_school", "building=commercial", 27
"language_school", "building=house", 29
"language_school", "building=retail", 11
"language_school", "building=school", 97
"language_school", "building=yes", 1017
"music_school", "building=apartments", 12
"music_school", "building=civic", 52
"music_school", "building=commercial", 31
"music_school", "building=house", 46
"music_school", "building=public", 46
"music_school", "building=residential", 11
"music_school", "building=retail", 12
"music_school", "building=school", 476
"music_school", "building=university", 15
"music_school", "building=yes", 2372
"prep_school", "building=commercial", 36
"prep_school", "building=retail", 43
"prep_school", "building=school", 31
"prep_school", "building=yes", 1111
"school", "building=apartments", 93
"school", "building=building_concrete", 50
"school", "building=church", 72
"school", "building=civic", 810
"school", "building=college", 80
"school", "building=commercial", 203
"school", "building=construction", 53
"school", "building=detached", 34
"school", "building=dormitory", 15
"school", "building=education", 26
"school", "building=government", 104
"school", "building=hospital", 16
"school", "building=house", 535
"school", "building=industrial", 42
"school", "building=kindergarten", 150
"school", "building=mosque", 11
"school", "building=no", 344
"school", "building=office", 60
"school", "building=public", 272
"school", "building=residential", 346
"school", "building=retail", 20
"school", "building=roof", 55
"school", "building=school;yes", 11
"school", "building=school", 36311
"school", "building=service", 19
"school", "building=shed", 15
"school", "building=sports_hall", 31
"school", "building=toilets", 28
"school", "building=university", 47
"school", "building=warehouse", 25
"school", "building=yes", 58385
"university", "building=apartments", 24
"university", "building=civic", 49
"university", "building=college", 45
"university", "building=commercial", 26
"university", "building=dormitory", 57
"university", "building=government", 14
"university", "building=hospital", 20
"university", "building=house", 54
"university", "building=industrial", 11
"university", "building=office", 119
"university", "building=public", 131
"university", "building=residential", 41
"university", "building=roof", 12
"university", "building=school", 387
"university", "building=university", 2374
"university", "building=yes", 5140

Metadata

Metadata

Assignees

No one assigned

    Labels

    waitfor-discussiona discussion in the osm community (e.g. a tag proposal) is required before this can be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions