I’m making an initial version of places.pub available today. places.pub is a collection of Place objects suitable for use in geosocial applications on the ActivityPub network.
Part of my work in the Social Web Community Group at the W3C has been participation in the GeoSocial Task Force. This is a sub-group of the SocialCG that focuses on implementing user stories in ActivityPub related to the intersection of geographical systems and social networking, for example, tagging an image with the place it represents, or checking in to a location.
One important need for geosocial software is that all objects in ActivityPub, including Place objects, need to have a permanent URL as their id
property, which shares the description of that object in Activity Streams 2.0 format. However, there isn’t a good dataset of geographical objects — countries, states or provinces or regions, cities, buildings, businesses, parks, streets — available in AS2 on the Web right now. That is slowing down experimentation in the Geosocial Task Force.
Using the service
So, I worked on making places.pub for geosocial hackers to experiment with. It’s a service that exposes places from the amazing OpenStreetMap collection of data as AS2 objects on the Web. So, given an OpenStreetMap object like the Rogers Centre Ottawa, it provides an AS2 version suitable for use in geosocial activities in ActivityPub. It also has a rudimentary search mechanism, although I think most users will want to use the Nominatim service for searching the OpenStreetMap database, and then map the IDs onto places.pub.
Once you know the places.pub ID for a place, you can use it for geotagging objects, people, activities, or using special geosocial activity types like check in, check out, and travel. There is a good list of examples on the places.pub home page, but obviously this is not an exhaustive list!
How it is built
This wasn’t my first time trying to build places.pub; I’d done two earlier versions with different architectures and the same interface. The first time out, about 7 years ago, I created a full NodeJS server that used a full mirror of the OpenStreetMap database, so I didn’t need to hit the OSM API to fetch data. It worked pretty well, but it was really expensive — hundreds of dollars per month to keep a database server of that size running and synched.
I tried a second version a few months ago, which did batch generation of AS2 Place
objects from the OpenStreetMap exports, and then uploaded them to the S3 service at Amazon Web Services. This was a whole lot cheaper, but it took a long time to download, convert, and re-upload the data.
This third implementation, with source code available on GitHub, is a little bit easier than both. Instead of sloshing the huge OSM dataset back and forth, I used the version of the data stored in the Google Cloud Public Datasets system on BigQuery. This let me ignore the effort of moving data, and just focus on giving it a good ActivityPub-compatible interface using a Google Cloud Run function. It seems to work pretty nicely.
Next steps
I’d love to see some experimentation with using places.pub for geosocial activity in the social web. I’m going to work on some implementations in my own ActivityPub software. If you find problems with the software, please add an issue on GitHub or let me know on the Fediverse at @evanprodromou.