Hi Michael, SVG support has only recently been added to Mapnik, and is currently just available only in the development code (current trunk, aka Mapnik2).
So, in the future this will be way easier but for now requires some special steps. If you are running Mac OS X I have a Mapnik2 installer I'm working on, so get in touch off list if you want to try that (just in beta testing). As far as Mapnik2 on linux, find build instructions at http://trac.mapnik.org/wiki/Mapnik2. Regarding Cascadenik we have a branch in the works to support Mapnik 2.0 which you can get to at github: https://github.com/mapnik/Cascadenik/ View by selecting the "Mapnik2" dropdown on the branches link on the left side. And checkout the code like: git clone git://github.com/mapnik/Cascadenik.git cd Cascadenik git branch -a git checkout mapnik2 Dane On Jan 28, 2011, at 10:35 AM, Michael Corey wrote: > Hi all: > > Apologies if this is a repeat post -- I'm not sure if this actually made it > on the listserv yesterday. > > 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: > > traceback (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> > > 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 _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

