Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A list of possibly deprecated tags that are still used as special phrases #103

Closed
69 tasks
tyrasd opened this issue Jan 15, 2014 · 9 comments
Closed
69 tasks

Comments

@tyrasd
Copy link

tyrasd commented Jan 15, 2014

So, I wrote this script that cross-checks all key-value combinations from Nominatim's special phrases lists with the taginfo database to find outdated, misspelled or otherwise bogus candidates. Tags that can't be found on neither the tables for popular tags nor the table for wiki-documented tags are filtered out. (I've already done a very similar analysis for the openstreetmap-carto stylesheet and thought that it might be a good idea for Nominatim as well.)

In the end I've come up with the following list of tags that are used by Nominatim, but are undocumented and not used widely:

amenity

historic

landuse

natural

place

railway

shop

tourism

waterway

@lonvia
Copy link
Member

lonvia commented Dec 18, 2014

Somebody really needs to go through the wiki pages and remove these class/tag combinations in order to get rid of them in Nominatim.

@saerdnaer
Copy link

@lonvia Can you explain your wiki change request in more detail?

@lonvia
Copy link
Member

lonvia commented Jan 16, 2015

The special phrases are taken from the language tables in der Wiki here: https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases To get rid of the special phrases, the entries need to be removed in all the tables in all languages.

@saerdnaer
Copy link

So basically all tags listed in the first comment should be removed at this wiki pages?

@lonvia
Copy link
Member

lonvia commented Jan 16, 2015

jup

@scaidermern
Copy link

scaidermern commented Dec 14, 2016

Did someone cross-check this list? Why is e.g. natural=valley considered "outdated, misspelled or otherwise bogus"? Maybe it's the only tag from the list that should be kept.

Removing this list of tags from the wiki pages sounds easy and can be done with a little script. But only if we agree on which ones to remove.

@tyrasd
Copy link
Author

tyrasd commented Dec 14, 2016

Why is e.g. natural=valley considered outdated […]

because at the time of writing it didn't have a wiki page and wasn't used often enough for taginfo to consider it popular (on http://taghistory.raifer.tech/ you can check that in early 2014 it was indeed not yet used very often).

I've removed it from the list now.

@scaidermern
Copy link

Oh, I see. In that case I intend to update the special phrases list in the next few days.

@scaidermern
Copy link

scaidermern commented Dec 15, 2016

Done.

In case anyone wants to know how I did this:

  1. Copy'n'paste the tag list from the first post into your favorite text editor, remove the intermediate headings (amenity, historic etc.) to just have a list of tags, save it to a file (lets call it toremove)
  2. Transform the list of tags from the file in a sed expression. This sed expression should be able to delete lines containing these tags from a file and remove the following line too (due to the table structure from the special phrases wiki page): awk '{print $1}' toremove | awk -F= '{print $1 " || " $2}' toremove | while read line; do echo $line | echo /$line/,+1d; done | tr -s "\n" ";"
  3. Download the raw page for each language: for lang in AF AR BR CA CS DE DE_AT EN ES ET EU FA FI FR GL HR HU IA IS IT JA MK NL NO PL PS PT RU SK SL SV UK VI; do wget "https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases/$lang?action=raw"; done. The files will called AF?action=raw, AR?action=raw and so on.
  4. Apply the automatically generated sed expression from 3. to each of these files: sed -i "/amenity || auditorium/,+1d;/amenity || club/,+1d;/amenity || dormitory/,+1d;/amenity || hall/,+1d;/amenity || health_centre/,+1d;/amenity || hotel/,+1d;/amenity || market/,+1d;/amenity || nursery/,+1d;/amenity || office/,+1d;/amenity || park/,+1d;/amenity || preschool/,+1d;/amenity || public_market/,+1d;/amenity || reception_area/,+1d;/amenity || shop/,+1d;/amenity || shopping/,+1d;/amenity || social_club/,+1d;/amenity || supermarket/,+1d;/amenity || wifi/,+1d;/amenity || youth_centre/,+1d;/amenity || mountain_rescue/,+1d;/amenity || village_hall/,+1d;/historic || church/,+1d;/historic || house/,+1d;/historic || icon/,+1d;/historic || museum/,+1d;/historic || tower/,+1d;/landuse || mine/,+1d;/landuse || mountain/,+1d;/landuse || nature_reserve/,+1d;/landuse || park/,+1d;/landuse || plaza/,+1d;/landuse || wetland/,+1d;/natural || channel/,+1d;/natural || crater/,+1d;/natural || feature/,+1d;/natural || geyser/,+1d;/natural || hill/,+1d;/natural || island/,+1d;/natural || point/,+1d;/natural || river/,+1d;/natural || strait/,+1d;/natural || wetlands/,+1d;/natural || fjord/,+1d;/natural || islet/,+1d;/place || postcode/,+1d;/place || subdivision/,+1d;/place || unincorporated_area/,+1d;/place || moor/,+1d;/railway || disused_station/,+1d;/railway || historic_station/,+1d;/railway || junction/,+1d;/railway || spur/,+1d;/railway || yard/,+1d;/shop || apparel/,+1d;/shop || car_dealer/,+1d;/shop || cosmetics/,+1d;/shop || discount/,+1d;/shop || drugstore/,+1d;/shop || gallery/,+1d;/shop || grocery/,+1d;/shop || market/,+1d;/tourism || bed_and_breakfast/,+1d;/tourism || cabin/,+1d;/tourism || lean_to/,+1d;/tourism || valley/,+1d;/waterway || connector/,+1d;/waterway || lock/,+1d;/waterway || mineral_spring/,+1d;/waterway || mooring/,+1d;" *action=raw
  5. Go to https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases and for each of the language pages do the following: open the page in your browser and click Edit Source. Open the corresponding language file we just had modified with sed, paste the content into the browser replacing the existing content. Now press See Changes to verify that we didn't break anything and just removed lines with the previously mentioned tags. Save. Very nice, great success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants