Tested on Mac OS 10.6.8
- Download kartograph.py
git clone https://github.com/kartograph/kartograph.py kartograph
- Use setup.py to install Kartograph + required libraries
cd kartograph
sudo python setup.py install
Kartograph at least needs a shapefile to create a svg map from. You can download public domain shapefiles from naturalearthdata.com. If you only want to test the installation, grab and unzip the following shapefile of the United States.
wget http://data.kartograph.org/united-states.zip
unzip united-states.zip -d shp
Now create a very simple map configuration and store it to map.yaml
layers:
- src: shp/united-states.shp
bounds:
mode: bbox
data: [-120,25,-73,50]
Now you can generate the SVG map using
kartograph svg map.yaml -o states.svg
If you want to preview generated maps automatically, save the following script to ```/usr/local/bin/firefox` (make sure to point it to the location where you installed Firefox on your system).
#!/bin/sh
open -a /Applications/Firefox.app $1
You need to install required libraries
###shapefile (http://code.google.com/p/pyshp/)
One of the following should work
sudo pypm install pyshp
easy_install pyshp
This should work:
pip install polygon
Alternatively download mac binaries from
and copy the folder "Polygon" into
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
git clone https://github.com/kartograph/kartograph.py
Output should look like this:
Cloning into kartograph.py...
remote: Counting objects: 422, done.
remote: Compressing objects: 100% (265/265), done.
remote: Total 422 (delta 210), reused 353 (delta 141)
Receiving objects: 100% (422/422), 38.82 MiB | 458 KiB/s, Resolving deltas: 100% (210/210), done.