LocalWiki uses GeoJSON in our API.
I'm trying to come up with an export format that preserves as much of the data we have in a given Localwiki into a single export file, for ease of off-site backups that are sensible.
The idea I came up with is to use GeoJSON as the export format, with one entry per page, and a suitably complex geometry structure to accompany each one. GeoJSON could sensibly handle version control by having a structure that included back versions of pages along with the current version, and it captures the geometry of the map points we have.
I don't have a solution for the image store, except that you'd want to drop a tar ball with all of the images in it.
I think this could be done entirely through the API, and I also think that a simple version would be relatively easy to do (if instead of backing up the data you just linked to it).
Little bits of feedback:
- We're using GeoJSON in the API right now (e.g. https://localwiki.org/api/v4/maps/), but the JSON /result/ itself isn't contained inside of a GeoJSON geometry. Instead, GeoJSON is returned as one of the attributes on the map resource. This is so that we have consistent API formatting between endpoints, as not every API resource is going to have a geometry and thus couldn't be represented inside of GeoJSON formatted JSON.
- Not all pages have a map, so that would need to be taken into account. Additionally, I'm not sure that this would work well with historical revisions, as you could end up with a really tangled, self-referential mess.
- If the most important thing here is just having a single JSON file representing material, I think the simplest thing would be to just concatenate all of the JSON results into a single JSON structure, mirroring the current API resource formatting. The only advantage the GeoJSON formatting has here is you could e.g. very quickly drag and drop it into a GIS program / service and see map points, etc, which would be cool. But maybe better served by a 'localwiki-to-geojson' utility that doesn't also have to deal with historical revisions + a full export of all changes?