App 2.39.0, server 2.7.0: Grid with map
A new Overview style: the Grid over the roads round the car from
OpenStreetMap, drawn in the floor's perspective, heading up, the bigger
roads glowing brighter, the car as a chevron.
Server: POST /v1/map/roads {z:14,x,y} fetches a tile's drivable roads
from Overpass (OVERPASS_URL; one request at a time, at least a second
apart), simplifies them to tile-local points in four classes, caches
them for 30 days and never logs the tile.
App: MapRoads keeps the 3x3 tiles round the car from its own cache or
the server; GPS only while the style is shown; bearing from the GPS or
from successive positions. Without GPS, server or roads the plain floor
says why. OSM attribution on screen and in LICENSE.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
@@ -23,6 +23,7 @@ Environment only; the server refuses to start when a required value is missing.
|
||||
| `APPROVAL_PASSWORD` | optional, at least 12 characters; switches pairing on (see below) |
|
||||
| `PUBLIC_URL` | the address a phone uses, for the pairing QR code; derived from the request if empty |
|
||||
| `FORGE_URL`, `FORGE_REPO`, `FORGE_TOKEN` | optional; app updates (below). The token only needs to read the repository |
|
||||
| `OVERPASS_URL` | the Overpass API the map's roads come from; default `https://overpass-api.de/api/interpreter`, `off` switches maps off, otherwise https only |
|
||||
| `LISTEN_ADDR` | default `:8080` |
|
||||
|
||||
## Endpoints
|
||||
@@ -57,6 +58,21 @@ shared ingest token): `update check` (how many releases, the newest pre-release)
|
||||
download started` (file, size), then `update handed out` (bytes sent, time taken) or `update
|
||||
download cut short`. The forge's address and token never appear in the log.
|
||||
|
||||
## Map roads
|
||||
|
||||
`POST /v1/map/roads` `{z, x, y}`, with the car's token: the drivable roads (motorway to
|
||||
residential) of one web-mercator tile at zoom 14, for the app's "Grid with map" style. The car
|
||||
names the tile, not its position, and in the body, so it stays out of access logs. The answer is
|
||||
`{z, x, y, extent: 4096, ways: [{c, p: [x, y, …]}]}`: per road its class (0 motorway and trunk,
|
||||
1 primary and secondary, 2 tertiary and unclassified, 3 residential and living streets) and its
|
||||
points in tile units, simplified to about 1.5 m; gzipped when the car accepts it (20–30 KB a tile
|
||||
in a city before that). The roads come from OpenStreetMap through `OVERPASS_URL`, one request at
|
||||
a time and at most one a second, with a User-Agent naming this service, and are kept in memory
|
||||
for 30 days (up to 3000 tiles); the car keeps its own copy too. 400 for anything but zoom 14 or
|
||||
a tile outside it, 503 when Overpass is busy or unreachable (not cached, the car tries again a
|
||||
minute later), 404 when maps are off. The log says `map tile fetched` with the car's installation
|
||||
and the size, never the tile. Map data © OpenStreetMap contributors, ODbL.
|
||||
|
||||
## Settings from a phone
|
||||
|
||||
The ABRP credentials are long to type on the car. With pairing on, the car (with its own token)
|
||||
|
||||
Reference in New Issue
Block a user