Sunday, February 13, 2011

Just finished my first town

I've just finished mapping my first town in OpenStreetMap, and coincidently it's also the first town where I lived: Crépy-en-Valois. Completed it using mainly the "cadastre" from the French authorities, and the Bing imagery, and the memories I have from spending 15 years there (turned out to be extremely useful).

Of course a place is never fully mapped, but here is can be found:
* all the streets
* all the streets names
* the shape of every building

I finished by naming the streets, and to ensure the quality, I compared the list of street names found on internet (from the phone directory) to the list in OpenStreetMap. I converted the directory data into a text file with one name per street alphabetically sorted.

To get the list of streets in OSM, the nominatim service seemed the most appropriate but I seemed not to answer this type of query. So eventually I settled with a very basic command:
curl -g "http://api.openstreetmap.org/api/0.6/map?bbox=2.8634295463562,49.2131958007812,2.93606853485107,49.2601203918457"
| grep =\"name | sort -u | sed -re "s/.*v=\"(.*)\".*/\1/;s/'/'/" > names-osm.txt

As long as there aren't many amenities, it works fine. Then using a diff tool (I used Meld), you can see which street is still missing, or where there are spelling mistakes. It turned out to be really useful. In addition to knowing there are 212 streets in such a small town, it even allowed me to notice small streets I had forgotten to map, and some streets whose name are not on the cadastre!