Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Foreign and Commonwealth Office Travel Advice
Ruby JavaScript CSS Shell
Tag: release_3

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
data
db
doc
lib
log
public
script
test
vendor
.gitignore
Gemfile
Gemfile.lock
Guardfile
README.md
Rakefile
config.ru
jenkins.sh

README.md

Foreign and Commonwealth Office Travel Advice & News

This app forms part of the Gov UK platform. It provides FCO Travel Advice and News.

Requirements

  • Rails 3.1
  • MySQL

How to use

rake api:import synchronises with the FCO API. Run as often as you like.

About the maps

The map tiles were generated using TileMill, with the following stylesheet:

@base: #95cfee;
@land: #438214;

Map { background-color:@base; }

.water-poly { polygon-fill:@base; }

#land[zoom>=0] {
  polygon-fill: @land;
  polygon-gamma:0.7;
}

This was then exported at zoom levels 1-8 for the whole world to a MBTile file. This file was then converted into an {x}/{y}/{z} tree of PNG images, using TileStache:

./tilestache-seed.py --from-mbtiles coastlines.mbtiles -c tilestache_config.json --layer coastlines

With the config file:

{
  "cache": {
    "name": "Disk",
    "path": "/tmp/stache",
    "umask": "0000",
    "dirs": "portable",
    "gzip": ["xml", "json"]
  },
  "layers": {
    "coastlines": {
      "provider": {
        "name": "mbtiles",
        "tileset": "coastlines.mbtiles"
      }
    }
  }
}

This tree of files was then uploaded to the Amazon S3 bucket tiles.alphagov.co.uk/coastlines.

The country borders are provided as vector files. These were download from the Natural Earth 50m cultural dataset, and converted to GeoJSON using ogr2ogr:

ogr2ogr -f "GeoJSON" borders.json ne_50m_admin_0_countries.shp ne_50m_admin_0_countries

There's a rake task maps:generate_border_files that takes the borders.json file in data and converts it to separate files for each country, named by the ISO code and placed into public/fco-assets/borders.

Something went wrong with that request. Please try again.