Created
February 11, 2014 00:30
-
-
Save nickponline/8927098 to your computer and use it in GitHub Desktop.
Install TileMill from source with recent GDAL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo rm /etc/apt/sources.list.d/*mapnik* | |
sudo rm /etc/apt/sources.list.d/*developmentseed* | |
sudo rm /etc/apt/sources.list.d/*chris-lea* | |
sudo rm /etc/apt/sources.list.d/*ubuntugis* | |
# Add bleeding edge PPAs | |
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js | |
echo 'yes' | sudo apt-add-repository ppa:mapnik/v2.2.0 | |
echo 'yes' | sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable | |
echo 'yes' | sudo add-apt-repository ppa:mapnik/boost | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
# Install package dependencies, some of these are redundant. | |
sudo apt-get install -y fluxbox vnc4server git-core libfreetype6-dev unzip build-essential subversion libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev | |
sudo apt-get install -y g++ cpp libicu-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev python-dev libxml2 libxml2-dev libfreetype6 libfreetype6-dev libjpeg-dev libltdl7 libltdl-dev libpng-dev libproj-dev libgeotiff-dev libtiff-dev libtiffxx0c2 libcairo2 libcairo2-dev python-cairo python-cairo-dev libcairomm-1.0-1 libcairomm-1.0-dev ttf-unifont ttf-dejavu ttf-dejavu-core ttf-dejavu-extra git build-essential python-nose clang libgdal1-dev python-gdal postgresql-9.1 postgresql-server-dev-9.1 postgresql-contrib-9.1 postgresql-9.1-postgis libsqlite3-dev | |
sudo apt-get install -y nodejs git build-essential libgtk2.0-dev libwebkitgtk-dev protobuf-compiler libprotobuf-lite7 libprotobuf-dev libgdal1-dev | |
# Build proj4 | |
wget http://download.osgeo.org/proj/proj-datumgrid-1.5.zip | |
svn co http://svn.osgeo.org/metacrs/proj/trunk/proj proj-trunk # at the time pre-release 4.8.0 | |
cd proj-trunk/nad | |
unzip -o ../../proj-datumgrid-1.5.zip | |
cd ../ | |
./configure | |
make | |
make install | |
# Build mapnik | |
git clone http://github.com/mapnik/mapnik | |
cd mapnik | |
git checkout 2.3.x | |
./configure | |
make && sudo make install | |
# Setup Postgres | |
POSTGRES_VERSION=9.1 # you may need to change this depending on ubuntu version | |
POSTGIS_VERSION="1.5" # you may need to change this depending on ubuntu version | |
sudo apt-get install -y postgresql postgresql-server-dev-$POSTGRES_VERSION postgresql-$POSTGRES_VERSION-postgis | |
sudo su postgres | |
# we lost variables, reset them | |
POSTGRES_VERSION=9.1 # you may need to change this | |
POSTGIS_VERSION="1.5" # you may need to change this | |
createuser pgis # yes to super | |
createdb template_postgis | |
createlang -d template_postgis plpgsql # you may not need this | |
POSTGIS_PATH=`pg_config --sharedir`/contrib/postgis-$POSTGIS_VERSION | |
psql -d template_postgis -f $POSTGIS_PATH/postgis.sql | |
psql -d template_postgis -f $POSTGIS_PATH/spatial_ref_sys.sql | |
exit | |
# Build Tilemill | |
git clone https://github.com/mapbox/tilemill.git | |
cd tilemill | |
npm install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment