Data Sources

The BMS map sources configuration (data/map/bms-map-sources.json) includes 13 LocalTileServer sources that point to the tile server. These are offline mirrors of their remote counterparts.

Available Local Sources

Local Source Name Remote Source Type
Local - OpenStreetMap OpenStreetMap - Standard Street
Local - ESRI World Imagery ESRI - World Imagery Satellite
Local - Google Hybrid Google - Hybrid Hybrid
Local - Google Satellite Google - Satellite Only Satellite
Local - CartoDB Dark CartoDB - Dark Matter Dark theme
Local - OpenTopoMap OpenTopoMap Topographic
Local - Sentinel-2 True Color Sentinel-2 L2A - True Color Satellite
Local - Sentinel-2 False Color Sentinel-2 L2A - False Color Vegetation
Local - OpenSeaMap Base OpenSeaMap – Base Chart Nautical
Local - Bing Satellite Bing - Satellite Satellite
Local - GA National Base Map GA - National Base Map Street
Local - GA Topographic GA - Topographic Topographic
Local - GA Satellite Imagery GA - Satellite Imagery Satellite

Configuring the BMS

The BMS reads sources from data/map/bms-map-sources.json (or the installed copy at /usr/share/gva/data/map/bms-map-sources.json). Each LocalTileServer entry looks like:

{
    "name": "Local - OpenStreetMap",
    "minZoom": 0,
    "maxZoom": 19,
    "tileType": "png",
    "tileUpdate": "None",
    "url": "http://localhost:8070/tiles/openstreetmap-openstreetmap---standard/{$z}/{$x}/{$y}.png",
    "backgroundColor": "#E8E0D8",
    "provider": "LocalTileServer",
    "noCache": true
}

Key fields:

  • url — Points to localhost:8070 with the source slug path
  • provider — Set to LocalTileServer to identify offline sources
  • noCache — Set to true to prevent double-caching (tiles already live in the tile server cache)

BMS Integration

The BMS application can use the local tile server as a map source. Sources with the LocalTileServer provider fetch tiles from http://localhost:8070/tiles/... instead of remote servers.

sequenceDiagram participant BMS as BMS App participant TS as Tile Server participant Cache as Tile Cache BMS->>TS: GET /tiles/osm/12/2038/1365.png TS->>Cache: Read /var/cache/gva-maptiles/osm/12/2038/1365.png Cache-->>TS: Tile data (52KB) TS-->>BMS: 200 OK (image/png) Note over BMS: noCache=true prevents
double-caching to disk

No-Cache Flag

Local tile server sources have "noCache": true in the map sources JSON. This tells the BMS not to re-cache tiles to disk since they are already stored in the tile server's cache. Tiles are still held in the BMS memory cache for fast rendering.

Adding a New Local Source

To add a new remote source as a local mirror:

  1. Sync the remote source to populate the cache:

    gva-tile-server --sync --source "USGS - Imagery" \
        --bbox "-77.1,38.8,-76.9,39.0" --zoom "0-14"
    
  2. Find the source slug (lowercase provider-name, spaces → -):

    curl http://localhost:8070/sources | python3 -m json.tool
    
  3. Add a LocalTileServer entry to bms-map-sources.json:

    {
        "name": "Local - USGS Imagery",
        "minZoom": 0,
        "maxZoom": 16,
        "tileType": "jpg",
        "tileUpdate": "None",
        "url": "http://localhost:8070/tiles/usgs-usgs---imagery/{$z}/{$x}/{$y}.jpg",
        "backgroundColor": "#000000",
        "provider": "LocalTileServer",
        "noCache": true
    }
    
  4. Restart the BMS — the new source appears in the map selector.

Tile Cache

Directory Structure

/var/cache/gva-maptiles/
├── openstreetmap-openstreetmap---standard/
│   ├── 0/0/0.png
│   ├── 7/63/42.png
│   └── 12/2038/1365.png
├── esri-esri---world-imagery/
│   └── ...
├── geoscienceaustralia-ga---national-base-map/
│   └── ...
└── copernicus-sentinel-2-l2a---true-color/
    └── ...

Shared Cache

Both the tile server (systemd) and BMS application share the same cache directory via a symlink:

~/.cache/gva-maptiles → /var/cache/gva-maptiles

This means tiles synced by the tile server are immediately available to the BMS, and tiles cached by the BMS during online operation are available to the tile server for serving.