This post describes a prototype for exposing Who’s On First (WOF) data and spatial functions for accessing that data in a (mostly) standalone binary driven by a simple data files (no databases).
It is working code to try and identify the outlines for a series of open questions about how geo services should be exposed in an ATProto context. It is not a suggestion that WOF data models be the lingua franca of ATProto geo applications.
The hope is that this package, and others like, can be installed and run locally with minimal fuss, by ATProto developers looking to add geo functionality to their applications in order to define the needs and shape of geo-services with concrete examples and use-cases.
The package comes bundled with “canned” data files for the San Francisco Bay Area so the only thing necessary to get started is a Go binary. This will start a server with XRPC endpoints for the following:
-
Point-in-polygon spatial queries.
-
Intersects (with geometry) spatial queries.
-
Point-in-polygon from ZXY map tile spatial queries. More specifically, the ability to user to query and specify a “place” where they are located (neighbourhood, locality, etc.) without exposing their exact coordinates to an external service or location provider. In that sense this is just syntactic sugar around the intersects query replacing a "bounding box” with a map tile (from which a bounding box is derived).
-
Basic “get record” lookups. Note: Currently this endpoint only returns a truncated WOF record. See below for a discussion of canonical lexicons for geo-shaped responses.
-
“Coarse” geocoding. Technically, this requires running the Placeholder server behind the scenes. This is easy enough to do if you are comfortable running node.js services and/or Docker services.
It is possible to run the service with global data files but those are not bundled with the package. Things this package does not do:
- Nearby (radial) queries.
- Venues. I’ll touch on that in a separate post.
- Attempt to define a canonical lexicon for geo-shaped responses. Currently it uses a combination of the Who’s On First “standard places response” and the Placeholder geocoding response. Again, the goal is not advocate for either one of those but just to start with something that people can say does or doesn’t do what they need, with running code, in order to arrive at a consensus.
The code itself is here: