Mapnik installation on Slackware 12.1
05/10/2008 // 2 comments // Category: My Everything // Thẻ: gis, mapnik, programming, slackware.Here are the steps that I managed to install Mapnik 0.5.1 on Slackware 12.1, it’s for personal documentation but might be helpful for some of you out there.
Depends on your current installed packages, you may be required to install some other packages, for details of the dependencies, please refer to it’s wiki
Mapnik requires the Boost libraries, International Components for Unicode, Freetype, Proj4, and a variety of image libraries.
Installing Boost is often new to mapnik users, but the majority of remaining dependencies are more familiar.
If you have previously built or installed other open source graphics or mapping applications it is likely that most of the remaining dependencies are already installed.
Currently detailed notes on mapnik dependencies are included in each platform specific installation instructions.
See MapnikInstallation for more information.
Before installation, check your boost lib compatibility here
The boost lib I got from LinuxPackages.Net for Slackware 12.1 is at version 1.36, which is not compatible with mapnik 0.5.1 (I got error while compiling), so I took boost version 1.35 from here
- Install boost lib package
- Install scons package (from slacky.eu), requiredbuilder (from stabellini.net )
- Download SlackBuild of Mapnik for Slackware 12.1 from slacky.eu , put everything in the same folder (e.x /home/download/mapnik-slackbuild/)
- running #./mapnik.SlackBuild
- If everything is ok, you will get mapnik package at the same folder with the slackbuild scripts, install it like other Slackware packages.
Test your Mapnik:
Once the installation is completed, you can test your installation by running a Python Hello World with Mapnik (You can see detailed instruction from here). Here is my summarization
1. Download the data, put it in /home/work/mapnik/data/ & unzip it
2. Copy the python code below, put in it a file name world.py at /home/work/mapnik/
#!/usr/bin/env pythonfrom mapnik import *
m = Map(600,300,“+proj=latlong +datum=WGS84″)
m.background = Color(’steelblue’)
s = Style()
r=Rule()
r.symbols.append(PolygonSymbolizer(Color(‘#f2eff9′)))
r.symbols.append(LineSymbolizer(Color(‘rgb(50%,50%,50%)’),0.1))
s.rules.append(r)
m.append_style(‘My Style’,s)
lyr = Layer(‘world’)
lyr.datasource = Shapefile(file=‘/home/work/mapnik/data/world_borders’)
lyr.styles.append(‘My Style’)
m.layers.append(lyr)
m.zoom_to_box(lyr.envelope())
render_to_file(m,‘world.png’, ‘png’)
3. Go to /home/work/mapnik/ and run the script #python world.py, if you get the world.png file in the same folder then everything is fine, mean the installation was successful
2 Responses to “Mapnik installation on Slackware 12.1”
Leave a Reply
Recent Posts
Recent Comments
- nandha63 on Eclipse 3.5 Galileo on Ubuntu Jaunty 9.04
- Gilberto Ramos on Get back your Alt+Ctrl+Backspace in Karmic
- Venkat Mantirraju on Eclipse 3.5 Galileo on Ubuntu Jaunty 9.04
- vinay on Google App Engine & cron jobs
- Abhishek Ransingh on Eclipse 3.5 Galileo on Ubuntu Jaunty 9.04
Blogroll
nandha63: works just fine man . . . . nice work mam . . . . . ...
Gilberto Ramos: very useful! i was looking for this..!
Venkat Mantirraju: This is an excellent guide. Thanks a lot for your effort and time in making ...
vinay: i am testing it on my local appengine . created successfully a cron.yaml and its
Abhishek Ransingh: Hi All, I've done all the steps which has been mentioned above. But, when last ...
Hamachi on Ubuntu Karmic Koala 9.10 error
27/10/2009
Speedup your flock browser (applied to firefox too)
25/10/2009
Get back your Alt+Ctrl+Backspace in Karmic
18/10/2009
Duplicate a website like Teleport on Ubuntu Jaunty Linux
14/10/2009
Looking no more! I found the best Mind Map for my Ubuntu
06/10/2009
Eclipse 3.5 Galileo on Ubuntu Jaunty 9.04
| 13 comments
vmware-tools on Slackware 12.1
| 3 comments
Google App Engine & cron jobs
| 3 comments
Django, Mod-Python & CouchDB
| 2 comments
Mapnik installation on Slackware 12.1
| 2 comments
- © 2009 Tech Mix. All rights reserved.
- WPLine 1.0 designed by Hutek - A member of Vietnam Wordpress Commnunity.
- Powered by Wordpress. Work fine on almost popular browsers.



October 5th, 2008 at 5:49 pm
Nice writeup.
Another great way of testing your installation is to go into the ‘demo/python’ folder within the source distribution of mapnik (ie. in trunk that is here: http://trac.mapnik.org/browser/trunk/demo/python). That will automatically output all the three possible AGG rendering formats (32 bit png, 8 bit png, and jpeg).
There is also a tool I’ve written called Nik2img.py which can read in a mapfile and auto-generate all AGG renderer formats with a special flag (the version in mapnik-util trunk does both Agg and Cairo renderer formats). Find that script here:
http://code.google.com/p/mapnik-utils/wiki/Nik2Img
October 6th, 2008 at 5:22 am
Thanks Dane for the information. I will definitely check them out, it was just my first step to approach Mapnik.