[Tilesathome] less inkscape runs

Alfons Andorfer a_a at gmx.de
Thu Aug 21 20:19:26 BST 2008


spaetz schrieb:
 > Render improvements:
 >
 > Somebody timed inkscape on a German forum and found that loading the
 > SVG takes most of the time, and exporting to png is rather
 > quick. Given that inkscape seems to render the whole SVG internally
 > anyway, even if we export only a small excerpt to png, I was
 > wondering if we should not make use of that fact, and simply export
 > the whole svg to one png in one render go. It could then be split up
 > into the tiles....
 >
 > Of course that doesn't help with memory consumption in Boston
 > downtown, but it would save us:
 > 1 render go at z13
 > 3 at z14
 > 7 at z15
 > 15 at z16
 > 31 at z17.
 >
 >
 > So we'd need only 6 inkscape calls, rather than 63 now (if I haven't
 > gotten that wrong).
 > This could be quite a timesaver.
Yes, it really _is_!

 > Worthwhile exploring?
I already did!
The result is an extension of the original "orp.pl" script which just 
goes one step farther and produces PNGs out of the SVG.
I've called it "osm2tiles.pl" and you can get it if you want. (I already 
sent it to Frederik, but didn't hear back from him yet)

 > It could also be done differently, depending on the tileset complexity
 > measure we get from the server.


Dirk-Lüder "Deelkar" Kreie wrote:
 > You are aware that the stripes are not equal in height, which is
 > precisely why there are 32 calls at z 17 (instead of 1024 as it used
 > to
 > be, BTW)
In my script this error is 0 ("zero") because I also changed the 
projection formula (from orp.pl) slightly.

My "osm2tiles.pl" script does the following if you want to render one tile:
- it reads the osm file and generates the internal data (no change to 
orp.pl"
- it loops from z12 to z17 and generates a SVG for every zoom level
- it produces _one_ PNG for every zoomlevel (256*256px for z12, 
512*512px for z13, 1024*1024px for z14,..., 8192*8192px for z17)
- it chops these BIG PNGs to 256*256px tiles


Alfons






More information about the Tilesathome mailing list