Skip to main content

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:

ColumnDescription
nameRoad name
curvatureRaw curvature score
distance_kmRoad length
road_typeOSM highway classification
surface_classpaved / unpaved / unknown
is_scenicOSM scenic tag flag
elevation_range_mMax minus min elevation along the road
elevation_gain_mTotal uphill elevation gain
min_elevation_mLowest point
max_elevation_mHighest point
min_water_dist_mDistance to nearest water body (sea, lake, river)
water_flagsBitmask: 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).

  1. The sheet shows a grid of 1°×1° cells for the current map view.
  2. Tap individual cells, or use Select all visible to queue a region.
  3. Tap Download — tiles download in the background and a progress indicator appears.
  4. 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

QueryOnlineOffline (tiles present)Offline (no tiles)
Curvy-road searchServer DB queryLocal SQLite queryNo results
POI searchServer PostGISLocal SQLite queryNo results
Route planningValhalla serverCached last routeCached last route only
Elevation chart/elevation/sample APINot available (needs server)Not available
Map tilesMapLibre onlineOnline onlyBlank map

Elevation profile charts (route and inline road chart) always require a server connection because they call the real-time /grass/elevation/sample endpoint.