Please put your hands together for... OpenStreetBlock -- a web service for turning a given lat/lon coordinate (e.g. 40.737813,-73.997887) into a textual description of the actual city block to which the coordinate points (e.g. "West 14th Street bet. 6th Ave. & 7th Ave") using OpenStreetMap data.
There are likely many applications for such a service. It should be quite useful any time one might need to succinctly describe a given location (or set of locations) without using a map. I imagine it would be particularly helpful for field testing a real-time bus tracking and customer information system using a smartphone or other small mobile browser.
The basic concept of how it works is the following.
- Start with a given lat/lon coordinate (40.737813,-73.997887, for example).
- Find the street segment ("way" in OpenStreetMap terminology) physically closest to the given coordinate. Assume this is the street we are on: in this case, "14th St."
- Find the two intersections ("nodes" in OpenStreetMap terminology) closest to the given coordinate on the selected street. Assume these are the intersections we are between.
- For each of those intersections, find the streets passing through those intersections. Exclude any intersecting streets with the same name as the selected street (the one we are "on"). Use the remaining streets to name the given intersection (the ones we are "between"): in this case, 6th Avenue and 7th Avenue.
- OpenStreetBlock also uses a configurable threshold parameter to determine whether we are "at" a given intersecting street rather than "between" two intersections (this is the so-called "Corner Threshold"). If we are within this threshold of the nearest intersection, drop the other intersection: in this case, we are not.
I've been hacking OpenStreetBlock on and off for several months now, and I finally found the time to clean it up a bit for release as a free-standing open source project. To learn more, read about the web service itself or try some example searches (this instance is only populated with OpenStreetMap data for NYC less Staten Island).