mapnik / Cascadenik

Cascading Sheets Of Style for Mapnik
http://github.com/mapnik/Cascadenik/wiki/Cascadenik
BSD 3-Clause "New" or "Revised" License
111 stars 20 forks source link

Problem with line-dasharray #11

Closed plepe closed 12 years ago

plepe commented 13 years ago

When I try to compile a style with a line-dasharray with more than two elements, I get the following message:

Traceback (most recent call last):
  File "/usr/local/bin/cascadenik-compile.py", line 92, in 
    sys.exit(main(layersfile, outputfile, **options.__dict__))
  File "/usr/local/bin/cascadenik-compile.py", line 33, in main
    cascadenik.load_map(mmap, src_file, dirname(realpath(dest_file)), **load_kwargs)
  File "/usr/local/lib/python2.6/dist-packages/cascadenik/__init__.py", line 65, in load_map
    compile(src_file, dirs, verbose, datasources_cfg=datasources_cfg).to_mapnik(map, dirs)
  File "/usr/local/lib/python2.6/dist-packages/cascadenik/output.py", line 54, in to_mapnik
    sym = symbolizer.to_mapnik()
  File "/usr/local/lib/python2.6/dist-packages/cascadenik/output.py", line 230, in to_mapnik
    stroke.add_dash(*self.dashes.values)
Boost.Python.ArgumentError: Python argument types in
    Stroke.add_dash(Stroke, int, int, int, int)
did not match C++ signature:
    add_dash(mapnik::stroke {lvalue}, float length, float gap)

The problematic rule looks like this:

.admin[admin_level=6][zoom>=14] {
  line-dasharray: 2,2,4,4;
  line-width: 3;
}

If I change the line-dasharray to

    line-dasharray: 2,2;

the compilation works.

I'm using the newest version (commit d607ac00a352aad574d62160ec8460292fd2e348) from Github.

Please fix!

springmeyer commented 13 years ago

k, will take some looking into that I don't have time for atm, but thanks very much for reporting. basically I'm not sure if this ever worked - but you are right that Cascadenik should be able to support the full expressiveness that Mapnik does for arrays

plepe commented 13 years ago

It definitely worked, I have an old version running on another system (SVN r768) and I'm using the same rules there. Thx for looking into it!

migurski commented 12 years ago

Fixed in fd8c79e, releasing as 2.0.1.