OpenStreetMap (OSM) holds a rich set of geographic data, including some unusual things like locations of bins or whether a pedestrian crossing has tactile paving. Programmatic access to this detail could help many people, especially those with access needs. Examples include planning routes that only use streets with tactile aids for blind or visually impaired people, finding nearby public toilets, or finding the accessible entrances (with wheelchair access tags) to every Cambridge college (a very specific usecase, but you get the idea we hope!).
OSM stores its data as key-value tags, and the data is entirely crowdsourced. The project enforces no strict schema. The community has defined some conventions for common kinds of entity on its wiki, but they are followed to very different extents. A tag system maintained organically by a community in this way is often called a folksonomy.
Existing query tools include
Overpass, which offers
high-level queries through an API, and osmium,
which offers fast lower-level queries over local data. Neither handles the
incomplete folksonomy well. A query for a route to a station along lit roads
might filter on [lit=yes] in Overpass, but this silently drops every road
that has no lit tag. Absence can be selected with [!lit], but it is still
treated as false, and reconciling the two by hand greatly complicates queries.
This project will make incompleteness part of the semantics of a query DSL. Filters will return a certain set and a possible set. By embedding the DSL in OCaml, it can use the type system to tell certain results from possible ones. It can also use typed tag accessors, in the form of lenses and prisms, that separate present, absent and malformed values. A tag value that cannot be interpreted under the community's conventions is then treated as unknown, just like a missing tag, so both sources of incompleteness are handled the same way. The gap between the certain and the possible is also useful in itself, since it shows OSM contributors where data is missing that would settle the query.
1 Related ideas
- Global habitat maps from Tessera embeddings could feed into this work by supplying habitat information for use in queries.
- Handling GPS uncertainty in point labels for Tessera addresses a similar problem of reasoning about uncertain geographic data.
