Table of Contents
Removed
- Python pickling support was removed for
map/style/rule/symbolizers/fontset/query
- these were poorly maintained and future support for fast, core deepcopy should handle most key use cases - see #1390 (map deepcopy) MetaWriter
- disabled in 2.1.x series - may be re-enabled in future releasesPointDatasource
- UseMemoryDatasource
instead. PointDatasource was an incomplete wrapper around MemoryDatasource, and is obsolete now thatFeature
objects can leverage WKB and WKT to create geometries and features can be added to MemoryDatasources.GlyphSymbolizer
- functionality can now be achieved with theTextSymbolizer
MarkersSymbolizer
marker-type
is removed, built in ellipse and arrow types now can be referenced likefile="shape://ellipse"
andfile="shape://arrow"
- although this interface is unstable and may continue to change.ShieldSymbolizer
attributeno_text
- Simply leave the text empty if you don't want any text to be rendered.- Removed
XML DTD
inutils/xml
since it was unmaintained: https://github.com/mapnik/mapnik/issues/1402 RasterSymbolizer
mode
divide
(see below)
Changed
MarkersSymbolizer
- default
marker-placement
is nowpoint
instead ofline
- meaning if you want your symbols (like arrows) to be oriented along lines you now need to specifyplacement=line
, whereas previously this was the default. This changes reflects the goal of making the MarkersSymbolizer default behavior more reasonable for any geometry type, including points, lines, and polygons and to make it consistent with theTextSymbolizer
andShieldSymbolizer
which also default topoint
placement. width
andheight
are now optional expressions rather than raw floats and their values represent diameter in pixels not radii. If not set they will beNone
, but the default ellipse has aradius
of10
meaning that if you setwidth="20"
andheight="20"
then there will be no change in the rendering size of the ellipse. The arrow default dimensions can be roughly maintained withwidth="15" height="10"
. But to get the exact rendering of the Mapnik 2.0.x arrow use this svg file. Altering width or height will build a newellipse
svg marker internally by default if no custom file type is provided. For non-ellipse types settingwidth
andheight
will proportionally scale the marker, but ideally you should use `transform="scale(x,y)" instead.- A new
fill-opacity
setting is available and nowopacity
reverse to a new overall opacity that will be multiplied against thefill-opacity
orstroke-opacity
- this is to match how svg behaves.
- default
- In Python a mapnik.Feature now expects a mapnik.Context() as a first argument and a feature id as the second argument, which stores all attribute names (previously mapnik.Feature only needed a single argument of the feature id and redundantly stored feature attribute names per feature) #834.
Added
-
MarkersSymbolizer
-
fill-opacity
is new. -
opacity
value now works to set the alpha of bitmap images. -
Expression
- you can now use the built in keyword of[mapnik::geometry_type]
to filter features by geometry type either by name or integer key. The mapping is0:no geometry
,1:point
,2:linestring
,3:polygon
, and4:collection
. A collection indicates that theFeature
has more than one geometry of different types. So aFeature
with three linestrings will be reported aslinestring
but aFeature
with a point and a linestring will be reported as acollection
. - for more details see #546 -
To All symbolizers (in most cases)
comp-op
- All symbolizers now support compositing in the AGG and Cairo renderersclip
- All(most) symbolizers - boolean of whether to clip geometries before rendering (defaults totrue
)smooth
- bezier smooth value - 0-1, 0 (default) means no smoothing, 1 means fully smoothed, higher values create wild loopbacks
-
LineSymbolizer
offset
- offset lines either in positive (right side) or negative (left side)stroke
miterlimit
added (https://developer.mozilla.org/en-US/docs/SVG/Attribute/stroke-miterlimit)
-
- New placement alogrithm:
list
- Text formatting
Changes documented in TextSymbolizer documentation
- New placement alogrithm:
-
Python Bindings:
mapnik.Image.get_pixel()
- get unsigned int value representing the rgba value, useful for fast pixel comparisonsmapnik.Grid.get_pixel()
- get int value representing the feature id encoded in the grid pixels- bindings for text placement and formatting work
Deprecated
-
TextSymbolizer
- most attributes moved to eitherformat
orplacements
propertiesproperties
:- label-placement
- horizontal-alignment
- justify-alignment
- vertical-alignment
- orientation
- displacement
- label-spacing
- label-position-tolerance
- avoid-edges
- minimum-distance
- minimum-padding
- minimum-path-length
- maximum-angle-char-delta
- force-odd-labels
- allow-overlap
- largest-bbox-only
- text-ratio
- wrap-width
format
:- face_name
- fontset
- text-size
- character-spacing
- line-spacing
- text-opacity
- wrap-char
- wrap-before
- text-transform
- fill
- halo-fill
- halo-radius
Backward compatibility is preserved by python wrappers, however a warning message is printed if the old name is used.
-
RasterSymbolizer
mode
is deprecated, now usecomp-op
which supports many more compositing modes- The new mapping from
mode
tocomp-op
is:normal
->src_over
grain_merge
andgrain_merge2
->grain-merge
multiply
->multiply
screen
->screen
hard_light
->hard-light
divide
anddivide
-> Not supported anymore, see: https://github.com/mapnik/mapnik/issues/1432
scaling=fast
is deprecated. It has always been a synonym fornear
, usenear
going forwardscaling
is now exposed in python as enumerations ofmapnik.scaling_method
not as bare strings