[OSM-talk] SVG tiles
tom at compton.nu
Mon Apr 21 14:48:56 BST 2008
In message <D89BADA3-5190-458A-AB1F-3D66EB4C8262 at poco.org.uk>
elvin ibbotson <elvin.ibbotson at poco.org.uk> wrote:
> I had been intending to get round to mailing this list enquiring if
> SVG downloads were possible/available when the Export tab appeared.
> My initial delight** was slightly diminished when I exported a map in
> two formats - SVG and PNG - and found the SVG version was 340kB while
> the PNG file was 132kB. A glance at the SVG data suggests that text
> is actually drawn (sometimes more than once (for background then
> again for the text itself) using long, elaborate paths and shape
> definitions of every character at every orientation and size, rather
> than just using the SVG text element!!! I suspect it also
> incorporates bitmap images as icons rather than using SVG
> definitions. I think SVG is the way forward, but not if the file
> sizes end up almost three times bigger than bitmaps!
Some of the text is drawn twice in order to get the halo effect
that our mapnik stylesheet uses. The icons are bitmaps because, as
I believe I explained yesterday, mapnik does not (currently) support
vector symbols. If you want to help with that I'm sure Artem will be
pleased to here from you.
Everything else is essentially down to cairo, which is the rendering
library that mapnik uses to render vector maps. I ask it to render
text using a given font and if it chooses to convert that to a path
then that is because it thinks it isn't possible to do it as a text
render for some reason.
In general terms SVG is pretty verbose anyway, so it's not at all
clear to be that it's ideal for what you are doing.
I would also point out that the export service was really designed
for people doing one of exports and not to act as a back end for the
sort of thing you're doing and it is unlikely to scale well to
supporting large scale use of that sort.
> I suggest that, if has not already been done and is hidden somewhere
> I haven't looked, that a server should be dedicated to scalable map
> tiles using a compact and efficient implementation of SVG coding.
Sure. I'll just look in the cupboard marked "spare servers" and pull
out a server for you. Then I'll go write stack of code and deploy and
manage it for you.
Seriously. You want it, you write it.
Tom Hughes (tom at compton.nu)
More information about the talk