I will answer inline...
On Aug 21, 2008, at 4:18 PM, Jared wrote:
> The presentation on Mapnik really got me interested so I started
> playing around.
Great, so you were able to install mapnik without a problem? It would
be great to know your system and method to get a sense of how you
> Could anyone point out some good/any documentation or
> better yet an example on how to use the ShieldSymbolizer?
Right, the ShieldSymbolizer sounds more tricky that is actually is.
All is it is kind of a combination of a PointSymbolizer with both text
and a graphic. A good example of the SheildSymbolizer is the
For highways they use a specific color and size rectangle
as a png graphic, and then add text on top of it. You can get more
fancy with the graphic, but you will have to create it yourself.
Mapnik does the rendering combination but DOES NOT have any prebuilt
graphics or symbols.
So, assuming your are rendering data from PostGIS in WGS 84
projection, to set this up you would download a sample 'shield'
rectangle png graphic from here:
then create a your XML mapfile like this while filling in the ALL_CAPS
<?xml version="1.0" encoding="utf-8"?>
<Map bgcolor="white" srs="+proj=latlong +datum=WGS84">
<ShieldSymbolizer name="FIELD_NAME_TO_LABEL" face_name="DejaVu
Sans Bold" size="11" fill="#809bc0" placement="line" file="/PATH/TO/
YOUR/symbols/motorway_shield4.png" type="png" width="31" height="17"
<Layer name="roads text labels" status="on" srs="+proj=latlong
<Parameter name="table">YOUR_POSTGIS_ROADS_TABLE </Parameter>
Then read that into your python script and you should be able to
render your field value (a road name or id) on top of/within the
> Also, where
> are the Python API docs? I am primarily a Java programmer and I can't
> find anything resembling JavaDocs for the python bindings.
There are not currently API docs, infortunately. Luckily the mapnik
python bindings are fairly simple and straightforward names, so
experiementing with sample code and doing:
will get you basic api help.
Beyond that what I like to do is in a shell run:
$ pydoc -p 8080
and then open a browser and go to :
which will give you python-style api docs. Then click on the '_mapnik'
link to see the C++ api that is exposed within python. Docstrings and
code comments are wanting, so consider contributing patches when you
figure out what a function does!