Hi all:
I'm having a problem getting an SVG image to work as a PointSymbolizer
when running cascadenik-compile.py.
Here's the CSS I'm using:
.alluncertified
{
point-file:
url('/Users/semchie/Documents/CIR/seismic/mapnik/uncertified/testpoint8.svg');
point-width : 8 ;
point-height : 8 ;
point-allow-overlap : true ;
}
This works fine if I switch to a .png image, but when I run
cascadenik-compile.py with the .svg I get the following error:
raceback (most recent call last):
File "/usr/local/bin/cascadenik-compile.py", line 5, in <module>
pkg_resources.run_script('cascadenik==1.0.2', 'cascadenik-compile.py')
File
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py",
line 442, in run_script
self.require(requires)[0].run_script(script_name, ns)
File
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py",
line 1160, in run_script
execfile(script_filename, namespace, namespace)
File
"/Library/Python/2.6/site-packages/cascadenik-1.0.2-py2.6.egg/EGG-INFO/scripts/cascadenik-compile.py",
line 92, in <module>
sys.exit(main(layersfile, outputfile, **options.__dict__))
File
"/Library/Python/2.6/site-packages/cascadenik-1.0.2-py2.6.egg/EGG-INFO/scripts/cascadenik-compile.py",
line 33, in main
cascadenik.load_map(mmap, src_file, dirname(realpath(dest_file)),
**load_kwargs)
File
"/Library/Python/2.6/site-packages/cascadenik-1.0.2-py2.6.egg/cascadenik/__init__.py",
line 65, in load_map
compile(src_file, dirs, verbose,
datasources_cfg=datasources_cfg).to_mapnik(map, dirs)
File
"/Library/Python/2.6/site-packages/cascadenik-1.0.2-py2.6.egg/cascadenik/compile.py",
line 1547, in compile
get_point_rules(layer_declarations, dirs)))
File
"/Library/Python/2.6/site-packages/cascadenik-1.0.2-py2.6.egg/cascadenik/compile.py",
line 1221, in get_point_rules
and
post_process_symbolizer_image_file(str(values['point-file'].value), dirs) \
File
"/Library/Python/2.6/site-packages/cascadenik-1.0.2-py2.6.egg/cascadenik/compile.py",
line 1104, in post_process_symbolizer_image_file
img = Image.open(un_posix(path))
File
"/Library/Python/2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-universal.egg/Image.py",
line 1980, in open
raise IOError("cannot identify image file")
IOError: cannot identify image file
Is this likely a more general problem with .SVGs in cascadenik, or am I
perhaps having problems because of the way I exported the .SVG? I used
Adobe Illustrator with these settings:
SVG profiles: SVG 1.1
Type: SVG
Images
Location: Embed
This produces this for the SVG body:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG
Version: 6.00 Build 43363) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="800px" height="600px" viewBox="0 0 800 600"
enable-background="new 0 0 800 600" xml:space="preserve">
<circle fill="#C1272D" stroke="#000000" cx="295.643" cy="155.5" r="20.357"/>
</svg>
Thanks much!
Michael Corey
Digital Innovations Editor
Center for Investigative Reporting
510.809.3178
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users