Hello,

I have successfully compiled mapnik2 on CentOS 6.0.

Now I am trying to generate map using sample files:

1) world_map.py:
#!/usr/bin/env python

from mapnik2 import *

mapfile = 'world_styles.xml'
map_output = 'image2.png'
projection = '+proj=latlong +datum=WGS84'

m = Map(600, 300)
load_map(m, mapfile)
bbox = Envelope(Coord(-180.0, -90.0), Coord(180.0, 90.0))
m.zoom_to_box(bbox)
render_to_file(m, map_output)

2) world_styles.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map>
<Map background-color="steelblue" srs="+proj=longlat +ellps=WGS84
+datum=WGS84 +no_defs">
    <Style name="My Style">
        <Rule>
            <PolygonSymbolizer>
                <CssParameter name="fill">#00FF00</CssParameter>
            </PolygonSymbolizer>
            <LineSymbolizer>
                <CssParameter name="stroke">rgb(10%,10%,90%)</CssParameter>
                <CssParameter name="stroke-width">0.1</CssParameter>
            </LineSymbolizer>
        </Rule>
    </Style>

    <Layer name="world" srs="+proj=longlat +ellps=WGS84 +datum=WGS84
+no_defs">
        <StyleName>My Style</StyleName>
        <Datasource>
            <Parameter name="type">shape</Parameter>
            <Parameter
name="file">./world_boundaries/world_borders</Parameter>
        </Datasource>
    </Layer>
</Map>

The result image2.png is generated, but polygons' color is the default one
- grey (It should be lime. I have also tried different colors, but every
time I got grey color).
What am i doing wrong ?

Thank you beforehand.
With regards,

Joseph
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to