[OSM-talk-be] Openstreetmap (Antwerpen) implementation on our bed & breakfast website

Luc Van den Troost luc.antw at gmail.com
Thu Aug 7 09:02:12 UTC 2008


For our bed & breakfast in Antwerpen we needed a new map to use on our
website. The maps we used before (mapquest and the map from the official
city website) both changed their request procedure, so both links were
broken. 


In mean time the city of Antwerpen has been entered quite complete in
OpenStreetmap, so that it is usable now to guide our clients. 


We wanted to add something extra to the map: the exact position of our
bed & breakfast, and the possibility to find streets in Antwerpen, even
if the name was incomplete. 


To show this on the map, we use OpenLayers.


The result can be seen on http://www.bb2000.be/stratenzoeker


The search is much faster than with the OS search function, as it will
only search within the Antwerpen data, and a street can be found with a
partially streetname: entering RUI as search will give all the streets
that contain this lettercombination. 



The technical background



Here is the technical background of the process in short...

Who wants to have the full explanation and technical details (incl.
scripts) can ask me, I would be happy to help you set up a similar
system. It's under a WWICGI licence (Who Wants It Can Get It)


Getting, searching and displaying the streets. 


To get all the streets on the map we downloaded the OSM data for the
area that includes the whole surface of Antwerpen. For some reason this
had to be done in 3 overlapping parts. 

The .osm files got transfered into .gml files, and merged together. 

To remove the doubles (we started with overlapping areas) we sort the
whole file, and remove the double lines with a perl script. 

To have only the streets we limited the entries to those having the tags
'way', 'name' and 'highway'.

To limit the search result to Antwerpen we made a very rough simulation
of the city borders of Antwerpen (a bit larger, not to miss streets) and
selected only the streets (completely or partially) within this area. 


We now have a file containing an entry for every street containing the
name, and the coordinates of all nodes used in the map. 

>From this it is easy to make a search function that will lookup the
matching streets, and display them in a new map layer (using openlayers)

Luc







More information about the Talk-be mailing list