Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

PointSymbolizer

skorasaurus edited this page · 11 revisions
Clone this wiki locally

PointSymbolizer

A PointSymbolizer specifies the rendering of a "graphic symbol" at a point.

If you want to draw a graphic symbol and a text you would better use a ShieldSymbolizer.

Some options described here are not available in mapnik versions < 2.0.

parameter value default
file path to image file none
width px 4
height px 4
type png tiff svg none
allow-overlap allow text to overlap the point image; true/false false
opacity Opacity of the symbolizer: 0.0 - 1.0 1.0
transform SVG transform identity
ignore-placement allow subsequent point/shield symbolizers to overlap this symbol; true/false false

Examples

Default

XML

    <PointSymbolizer/> 

Python

    sym = PointSymbolizer()

C++

    using mapnik::point_symbolizer;
    point_symbolizer sym;

Image label

[[/images/point_symbolizer_2.png]]

XML

    <PointSymbolizer file="/tmp/pub.png" width="16" height="16" type="png" /> 

Python

    sym = PointSymbolizer("/tmp/pub.png", "png", 16, 16)
    # args are file, type, height, width
    sym.allow_overlap = True
    sym.opacity = .5

C++

    using mapnik::point_symbolizer;
    point_symbolizer sym("/tmp/pub.png","png",16,16);

Allow Overlap

XML

    <PointSymbolizer allow-overlap="yes" file="/Users/artem/projects/ 
    openstreetmap/mapnik/symbols/station_small.png" type="png" width="5"  
    height="5" />

Do Not Allow Overlap

XML

    <PointSymbolizer allow-overlap="no" file="/Users/artem/projects/ 
    openstreetmap/mapnik/symbols/station_small.png" type="png" width="5"  
    height="5" />

SVG symbols (trunk)

    <PointSymbolizer file="/Users/artem/Desktop/svg/lion.svg" opacity="1.0" transform="scale(0.2,0.2)" />

    <PointSymbolizer file="/Users/artem/Desktop/svg/lion.svg" opacity="1.0" transform="rotate(45) scale(0.4,0.4)" />
Something went wrong with that request. Please try again.