I've tried to render a few maps in Mapnik and I have a little problem. I want to render a map that contains two layers: point and polygon. I've used this script:
import mapnik rule = mapnik.Rule() rule.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color("darkgreen"))) rule.symbols.append(mapnik.PointSymbolizer()) style = mapnik.Style() style.rules.append(rule) layer = mapnik.Layer("mapLayer") layer.datasource = mapnik.Shapefile(file="polska.shp") layer.styles.append("mapStyle") map = mapnik.Map(640, 480) map.background = mapnik.Color("white") map.append_style("mapStyle", style) map.layers.append(layer) map.zoom_all() mapnik.render_to_file(map, "map.png", "png")
There is only one shapefile to render, but that is my problem. When I'm adding the 4th line
rule.symbols.append(mapnik.PointSymbolizer()), I always get rendered polygons with additional points (centroids of each object I guess):
Why are there black points? Is there any possibility to render two layers (polygons and points) at the same time, without these centroids? What am I doing wrong?