jfd553's Diary

Recent diary entries

ChatGpt and tagging in OpenStreetMap

Posted by jfd553 on 8 February 2023 in English.

Cartography in OSM is twofold: drawing and tagging. While the former only require the ability to click with a mouse for drawing a line on a screen, tagging a feature is more demanding. There are only two options for finding appropriate tags to describe a feature.

The first is to browse the wiki and find the feature’s page. Once there, you often need to dig through many other pages to find the accepted keys/values that would describe the detailed characteristics of the feature. All of this is very laborious, even for a seasoned contributor, particularly when mapping a feature for the first time.

The second option is to use search tools to find the tags you are looking for (keys or values). You can use a search engine (e.g., Google) by adding “OpenStreetMap Wiki” with your keywords to narrow down the results. You can also use OSM tools, such as TagInfo, TagFinder, OSMantic JOSM Plugin and some others. These tools work well if your keywords match existing keys or values, but it gets trickier if they don’t. However, for a few months now, a new tag search alternative has been offered: ChatGPT.

ChatGPT (Chat Generative Pre-trained Transformer) is a chatbot launched by OpenAI in November 2022 [1]. OpenAI is an artificial intelligence (AI) research and deployment company that gives a free access to its chatbot for the time of the “research preview” [2]. Basically, once registered, a user can ask any type of questions to the chatbot. I then decided to test the chatbot on its ability to find appropriate tags for OpenStreetMap features.

Since I’m currently working in tagging businesses, I tried a few ones. Here are a sequence of questions/answers tried on ChatGPT.

Q: What would be the tag use in OpenStreetMap for a restaurant serving pizza?

A: In OpenStreetMap, the tag for a restaurant serving pizza would be “amenity=restaurant” and “cuisine=pizza”.

The answer is good, but restaurants and pizza could easily be linked together. So, I decided to make it more difficult…

Q: What would be the tag use in OpenStreetMap for an establishment raising alpacas to make clothes?

A: In OpenStreetMap, the tag for an establishment raising alpacas to make clothes would be “landuse=farm” and “animal=alpaca”. Additionally, the “craft=textile_manufacturing” tag could be used to specify that the alpacas are being raised for textile production.

Wow, although craft=textile_manufacturing does not exist (yet), the value makes sense according to the clue I give to the chatbot. Someone tagging the feature for the first time will produce elaborate tags right from the start!

However, the tagging is not always perfect. For instance, here is an example that did not work exactly as expected.

Q: what would be the tag use in OpenStreetMap for describing a building material dealer for doors and windows?

A: In OpenStreetMap, the tag for describing a building material dealer for doors and windows would be “shop=doors” and “shop=windows”. Additionally, the “building_materials=yes” tag could be used to specify that the dealer sells building materials in general.

Well, in this case, the proposed keys and values exist in OpenStreetMap, but the answer is not adequate. First, it suggests using “shop=doors” and “shop=windows”. At a minimum, it should have suggested “shop=doors” or “shop=windows”, not both (although the latter is deprecated). Regarding building_materials=yes, building_materials is not a key but there is a section in the key=shop wiki page that uses it in a section header. Either way, this could have directed a contributor to the appropriate wiki pages.

In conclusion, ChatGPT (and other eventual competitors such as Bard) can really make tagging in OpenStreetMap easier. Using natural language without prior knowledge of expected tags greatly simplifies finding appropriate keys or values. It is certain that for the moment, the answers must be checked with OSM tools, but they should improve overtime.



Location: Rock Forest–Saint-Élie–Deauville, Sherbrooke, Estrie, Quebec, Canada

I have started a Covid-19 mapping project in mid-April of this year. My objective was to map the buildings in the city I live in (and updating what needs to be). So far everything is going well. After having mapped about 30K buildings, 80% of my objective has been achieved. I keep moving forward with mapping and updating buildings and any other features that interest me.

Location: Le Mont-Bellevue, Sherbrooke, Estrie, Quebec, Canada