Offline Data Tiles
FastGIS packages road curvature data and POI data as 1°×1° SQLite tiles that the mobile app downloads on demand. Once downloaded, searches and map queries work without an internet connection.
What's in a tile
Curvature tiles (curv-tiles/)
Each tile is a small SQLite file covering a 1° latitude × 1° longitude cell (e.g. tile 59_10 = lat 59–60°N, lon 10–11°E).
Every road row in a curvature tile includes:
| Column | Description |
|---|---|
name | Road name |
curvature | Raw curvature score |
distance_km | Road length |
road_type | OSM highway classification |
surface_class | paved / unpaved / unknown |
is_scenic | OSM scenic tag flag |
elevation_range_m | Max minus min elevation along the road |
elevation_gain_m | Total uphill elevation gain |
min_elevation_m | Lowest point |
max_elevation_m | Highest point |
min_water_dist_m | Distance to nearest water body (sea, lake, river) |
water_flags | Bitmask: 1=sea, 2=lake, 4=river |
Elevation data is enriched offline by scripts/enrich_elevation.py using the best available national DEM for each road's location. Water proximity is enriched by scripts/enrich_water_osm.py via Overpass API.
POI tiles (poi-tiles/)
Each tile contains points of interest (fuel stations, campsites, viewpoints, etc.) from the OSM POI database for that cell.
Downloading tiles
Open the Navigate tab → Offline Packs sheet (bottom-sheet swipe or menu).
- The sheet shows a grid of 1°×1° cells for the current map view.
- Tap individual cells, or use Select all visible to queue a region.
- Tap Download — tiles download in the background and a progress indicator appears.
- Completed tiles turn green. The app immediately starts using them for offline queries.
You can switch to aeroplane mode after downloading to test offline functionality.
Storage layout
Tiles are stored in the app's documentDirectory:
documentDirectory/
curv-tiles/
59_10.sqlite ← curvature tile lat 59, lon 10
59_11.sqlite
…
poi-tiles/
59_10.sqlite ← POI tile lat 59, lon 10
…
curvature/
roads.db ← monolithic DB (legacy / pre-tile download)
poi-bundles/
… ← legacy region bundles
Regenerating server-side tiles
When the server's roads database is enriched with new data (elevation, water proximity, scenic scores), the tiles need to be rebuilt:
# 1 — re-enrich the roads database
python scripts/enrich_elevation.py --source auto
python scripts/enrich_water_osm.py
# 2 — rebuild all tiles (--force overwrites existing files)
python scripts/build_curvature_tiles.py --force
python scripts/build_poi_tiles.py --force
# Or rebuild a specific region only (e.g. western Norway)
python scripts/build_curvature_tiles.py --force \
--lat-min 57 --lat-max 64 --lon-min 4 --lon-max 11
After rebuilding, the /grass/tiles/ API immediately serves the new files. Mobile users re-download using More → Settings → Reset offline data, then the Offline Packs sheet.
Offline query behaviour
| Query | Online | Offline (tiles present) | Offline (no tiles) |
|---|---|---|---|
| Curvy-road search | Server DB query | Local SQLite query | No results |
| POI search | Server PostGIS | Local SQLite query | No results |
| Route planning | Valhalla server | Cached last route | Cached last route only |
| Elevation chart | /elevation/sample API | Not available (needs server) | Not available |
| Map tiles | MapLibre online | Online only | Blank map |
Elevation profile charts (route and inline road chart) always require a server connection because they call the real-time /grass/elevation/sample endpoint.