Skip to content

MinnPost/minnpost-basemaps

Repository files navigation

A collection of instructions and relevant files for editing/creating the MinnPost base maps which are designed for use in Tilemill.

Dealing with Maps

Map names are assumed to be the name of the relevant directory.

  • Link map into MapBox projects: fab map:"<MAP-NAME>" link;
  • Unlink map into MapBox projects: fab map:"<MAP-NAME>" unlink;
  • Clone (and link) map: fab map:"<MAP-NAME>" clone:"<NEW-MAP-NAME>";

Deployment

To depoly a map, use the following. It will export the map as an mbtiles file, extract out tiles and json tiles, then deploy them to the various S3 buckets.

fab map:"<MAP-NAME>" production export_deploy:32

Optionally with min and max zoom levels:

fab map:"<MAP-NAME>" production export_deploy:32,7,8

Or for labels or without labels. These will create different folders on s3 for the respective type. <MAP-NAME>-label or <MAP-NAME>-no-label

fab map:"<MAP-NAME>" production no_labels export_deploy:32,7,8;
fab map:"<MAP-NAME>" production only_labels export_deploy:32,7,8

Setup

The following instructions are known to work on Mac OSX Lion and Snow Leopard.

Dependencies

Install dependencies.

  1. Install homebrew
  2. brew install s3cmd; s3cmd --configure, you will then be asked for the AWS key and secret key.
  3. brew install mapnik; Note the path prefix suggestion at the end of the mapnik install. You should add this to your .bash_profile
  4. sudo pip install -r requirements.txt;

OpenStreetMap data

This will take some time, so download the OSM file from Cloudmade to your Downloads folder.

Install PostGIS

  1. Download and run the Postgres and PostGIS images from Kyng Chaos.
  2. Run the following to include the Postgres bin to your path: echo 'PATH="$PATH:/usr/local/pgsql/bin"' >> ~/.bash_profile; source ~/.bash_profile;
  3. Setup a PostGIS template for making new databases. Assuming you are in this project's folder, run the following. source ./.postgis-setup.sh; postgis_setup;
  4. Create new PostGIS DB called 'minnpost_base_map': createdb -U postgres -h localhost -T template_postgis minnpost_base_map

Import OSM data into Postgres (osm2pgsql

Use osm2pgsql to import the data.

  1. Install dependencies (this will take some time, especially osm2pgsql; be patient): brew install automake; brew install libtool; brew install geos; brew install proj; brew install gdal --with-postgis;
  2. Install osm2pgsql: brew install --HEAD osm2pgsql;
  3. To import, run the following (this will take a while): osm2pgsql -K -c -G -U postgres -H localhost -d minnpost_base_map ~/Downloads/minnesota.osm.bz2

Open in TileMill

You should be able to open basemaps that use this date. Do note that it will take a fair amount of time to download the external shapefiles, and then render them. So, maybe work on something else for a bit.

Data Used

  • OpenStreetMap
  • Census for Minnesota outline.

Technologies Used

About

Instructions and relevant files for the MinnPost base map(s)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages