Re: [mapnik] Issue with using the Stroke's stroke-dash-offset property

157 views
Skip to first unread message

Artem Pavlenko

unread,
Aug 1, 2012, 12:23:36 PM8/1/12
to map...@googlegroups.com
It should be : "stroke-dashoffset"


On 1 August 2012 17:13, Andrew McCall <mcand...@gmail.com> wrote:
> Working on adding to the geotools2mapnik.py script for converting SLDs to
> mapnik style xml format, I set up a test .sld file to convert.
> When a "stroke-dashoffset" property is specified in the .sld, the converted
> mapnik style contains a "stroke-dash-offset" property that is not
> recognized when the mapnik.load_map() method attempts to parse the XML.
>
> I found a revision for mapnik.load_map() mentioning that the
> "stroke-dash-offset" property was changed to "stroke-dashoffset" for the
> mapnik XML.
> Is it possible that the mapnik.save_map() method was not updated to match
> this revision?
>
> The rule is converted into a mapnik style rule:
>
> <Rule>
> <LineSymbolizer stroke-dash-offset="8" stroke-dasharray="6, 7"/>
> </Rule>
>
> When loading the map that this style is located in, an error occurs:
>
> Traceback (most recent call last):
> File "geotools2mapnikDir.py", line 112, in <module>
> removeLayersFromXML(options.target)
> File "geotools2mapnikDir.py", line 45, in removeLayersFromXML
> mapnik.load_map(m,path)
> RuntimeError: The following nodes or attributes were not processed while
> parsing the xml file
> * attribute 'stroke-dash-offset' with value '8' in line 5

Andy Allan

unread,
Aug 1, 2012, 12:28:02 PM8/1/12
to map...@googlegroups.com
On 1 August 2012 17:23, Artem Pavlenko <ar...@mapnik.org> wrote:
> It should be : "stroke-dashoffset"

I think what he means is should this be changed:

https://github.com/mapnik/mapnik/blob/master/src/save_map.cpp#L468

i.e.

set_attr( node, "stroke-dash-offset", strk.dash_offset());

should be

set_attr( node, "stroke-dashoffset", strk.dash_offset());

Cheers,
Andy

Artem Pavlenko

unread,
Aug 1, 2012, 12:30:15 PM8/1/12
to map...@googlegroups.com
Correct, fixed in 8ff71a24bd6c473f5d63824212d552c3be8c789a

cheers!

> Cheers,
> Andy

Andrew McCall

unread,
Aug 1, 2012, 1:15:17 PM8/1/12
to map...@googlegroups.com
Thanks!
Reply all
Reply to author
Forward
0 new messages