OpenStreetMap

Python for data creation

Posted by escada on 22 July 2013 in English.

Normally I do my surveys with a Garmin GPS and make notes using waypoints. Those waypoints and the corresponding track can be loaded in JOSM. In order to update OSM, one still need to manually create nodes and add tags to them.

So I wrote a Python script that does part of this work. It converts the waypoints that I make into OSM points. I can then easily integrate those nodes with the existing data, without have to create notes or add tags.

The script recognizes the waypoints with the following formats:

- VB  for amenity: waste_basket  (Vuilbak)
- BK  for amenity: bench (Bank or Zitbank)
- FIREH for emergency: fire_hydrant
- M50/M70/Z70/Z30/Z50 for maxspeeds (Z for zones)
- PIKNIK for tourism: picnic_site
- WSS [name] for historic: wayside_shrine
- CDC for power: cable_distribution_cabinet
- ESS for power: sub_station
- STOP/GW  for highway: stop / give_way
- LLI/RLI for highway: street_lamp
- PAAL, KGATE, SWINGGATE, SWGATE, GATE, FBAR for
      barrier: bollard / kissing_gate, swing_gate, swing_gate, gate, cycle_barrier
- house number notations, e.g. R10, L10-12, L10+-+20, L10+12---13+15
- PB 1445 for bpost post_box with (last) collections_times Mo-Fr 14:15
- GLB for recycling glass bottle container (Glasbol)
- TXT for recycling clothes contains. Some operators are recognized as well WMS, VICT, ...

Since I am also interested in mapping protected buildings in Flanders, I often use the data that wikipedia has on this topic. An example can be found here.

Until this weekend, I manually located the building and added the necessary tags via a JOSM preset. On my previous diary entry someone suggestion using a toolserver service to obtain a kml-file with all the nodes.

It looks nice, but not all data from the wikipedia page was kept. So I wrote another small Python script to parse the wikipedia page, keeping as much data as possible (the image tags, the heritage flag, the URL). Furthermore I added some tags that are specific for buildings listed by the Flemish Onroerend Erfgoed institute.

I’m willing to send the scripts to anybody that asks for it. Note that I’m not going to fix bugs or implement additional features, but you can do that if you want.

Discussion

Log in to leave a comment