Closed samhavens closed 4 years ago
Hi! There isn't a road-map and this is a good place to talk.
The plan is to host an offline vector map of the local area on the disaster-radio nodes on a microsd card. This card will probably be 128 MB. The vector maps will be rendered in-browser by the client.
GPS will work on the devices accessing the disaster.radio web app, but of course only if they have GPS. The disaster.radio nodes will know their own positions (either through wifi-based positioning or because the node-operator is asked to provide this during initial setup).
Here are some of the challenges and my notes from when I last looked at it:
There is already software to do this but it should probably either be bundled as a vagrant system or at least set up on a server for the devs to access as getting this all set up is non-trivial.
We will need to strip out the zoom-levels we don't want (very near and very far) due to storage constraints, select the target geographical area and strip out irrelevant details in the map to both reduce map size and client-side rendering time. We will also want to change the styles (colors etc.) though that is less important right now.
https://github.com/openmaptiles/openmaptiles/
You can download a custom extract of openstreetmap tiles for $10 at: https://openmaptiles.com/extracts/
This might be useful to start developing on the other aspects of this project but eventually we'll need our own solution.
Some notes I wrote for myself a while back:
https://openmaptiles.org/docs/generate/create-custom-extract/
https://openmaptiles.com/downloads/
Install tilelive and MBTiles support.
npm install -g tilelive mbtiles
Visit boundingbox.klokantech.com and drag a rectangle around your desired area.
Copy the bounding box in CSV format
To create an extract the tilelive-copy utility is used. It takes a bounding box and a MBTiles file as input and creates an extract clipped to the bounding box.
Replace the bounding box in the following command with your bounding box.
tilelive-copy \
--minzoom=0 --maxzoom=14 \
--bounds="5.9559,45.818,10.4921,47.8084" \
planet.mbtiles extract.mbtiles
Use mbutil to extract .mbtiles to directory of vector files:
mb-util --image_format=pbf extract.mbtiles extract_dir/
These files will be called .pbf but they are actually .pbf.gz and if your webserver doesn't send gzip as the content-encoding then it won't work. To un-gzip them for development purposes do gunzip -S ".pbf" -r extract_dir
and ensure that the tiles url in the javascript now references e.g. /extract_dir/{z}/{x}/{y}
instead of /extract_dir/{z}/{x}/{y}.pbf
.
https://github.com/rastapasta/tilegrinder
https://github.com/rastapasta/tileshrink
We'll need something that is fast and light-weight for the client side rendering. The ESP8266 is slow at sending data over wifi so we don't want to hav eto send megabytes of javascript to the client.
Some of this might be interesting:
vector rendering for leaflet OSM OpenLayers In-browser tile slicing! probably not viable(?) but cool OSM editor
Serving up the tiles should be doable from just a properly organized file-system over HTTP. Mostly the challenge will be configuring the ESP8266 to talk to the microSD card and not having that interfere with the rest of its critical operation. We may have to switch to an ESP32 if this proves infeasible.
Heya! I saw this while I was on a train without wifi, and I wrote a bit about my thoughts on this:
Mapeo Desktop is a native Electron app for Windows, macoS, and Linux for viewing and editing offline maps, compatible with OpenStreetMap. Users sync map edits to each other using USB keys (a sneakernet or over the local network.
Disaster Radio is a long-range low-bandwidth mesh network that can be deployed at a city scale to permit networking in disaster situations, or in places that lack existing internet infrastructure.
Finally, Secure Scuttlebutt (SSB) is a distributed network protocol and platform, which works well in offline environments. Users exchange messages across peers using a gossip protocol, where friends share their feeds with other friends until they reach the breadth of their social graph.
Mapeo Desktop and SSB could be modified to work with Disaster Radio. Here is how I think this could work:
In OSM, all edits to a map are wrapped in a changeset, which has a unique identifier and can be used to identify all of the edits that were made by a certain user at a certain time. When a changeset is submitted via Mapeo:
diasterradio/map/changeset
message type.This dual-broadcast will allow the map edits to reach other users in two different ways:
Users can receive map edits in two ways, as established above: via a Disaster Radio node they are connected to via wifi, or from another user via SSB. Edits received over Disaster Radio will be published to their local SSB database, so that SSB can be used as the principal database for apps to read map data from.
Reading and writing map data will happen through a custom SSB plugin: a program we can pre-publish with Disaster Maps (or whatever we call it) that is offers APIs for publishing and querying map data.
Users who receive map edits via Disaster Radio will check their local SSB database to see if the edits have already been published. If they don't see the edits locally, they will publish that map data to SSB as well.
However, it's possible that the map edits were published to SSB by other users and just haven't propagated their way to this user yet. This means some map edit messages will be published to SSB multiple times. This redundancy is OK: the SSB plugin that exposes the map read/write API will deduplicate redundant messages so applications won't need to worry about it.
Aside from map elements like schools, lakes, and relief centers, there is also aerial / satellite imagery. This raster data is very useful for identifying landmarks and context that may not be explicitly placed by anyone on the map. It is essential that offline imagery be made available as well.
Mapeo supports bundling offline imagery, but it's still a fairly manual / technical process. It would be possible, in the interim, for Disaster Radio developers to pre-download and load this imagery for known areas of interest with the Mapeo bundled on USB keys.
Mapeo Desktop is an Electron app. Electron packages a subset of the Chromium web browser, so it is known for creating rather large app downloads. We determined that the app (over 50mb) will be too large to store and distribute from a Disaster Radio node, so for now the app will be packaged for all 3 major platforms on a USB key situations near/with each Disaster Radio node. This is flexible & powerful: other app authors could also distribute their apps on this key, or even store offline map data for an area that's ready to go!
Thanks! I am still just entering this world (SSB! Mesh! This stuff is so cool!), so forgive any n00b thoughts:
Definitely not n00b thoughts. :) Asking Qs from the user's POV feels like a good exercise.
This issue is stale. We have since written a mapping web app that uses MapBox tiles and requires an SD card to store the map tiles, https://github.com/sudomesh/disaster-radio-map, We also have a BLE android app that provides a map, https://github.com/beegee-tokyo/disaster-radio-android. There have been similar discussions about how to distribute the android app without real internet.
There are a lot of great ideas in this thread,so I encourage people continue referencing this issue, but I am going to close it to remove cruft.
If new ideas or issues arise related to maps or the distribution of apps/files on the network please open a fresh issue.
Apologies if this is not the right place for this
I believe there is supposed to be a map app for web. Is the intended design of that documented anywhere, and is there a development roadmap? I think an issue would be a good place for that. I have no idea where to start though... because the client can't assume that it has access to the corporate internet, right? Or can we make the assumption that pre-disaster, the user has opened the app while connected to the internet, so we can fetch some maps near them?
Also, I believe GPS still works with no service, so would a reasonable proposal be to use some react-leaflet type thing, with GPS (something like this)? But err on the small, lightweight, PWA side of things, like this neat app?
resources
Offline maps, a shared problem in need of a shared solution