[Tilesathome] Using Batik to render tiles instead of Inkscape
spaetz
osm at sspaeth.de
Fri Oct 5 11:20:53 BST 2007
On Fri, Oct 05, 2007 at 07:03:42PM +1000, Brent Easton wrote:
>
> >Hey that sounds really cool. I tried batik once and aborted the run after
> >like 30 minutes with 100% CPU utilization and no output. Seems like batik
> >is really strict on errors, but the cases you report sound fixable.
>
> Could you just run through the algorithm tilesgen.pl is using when rendering with Inkscape? I don't really follow how it is doing it.
No as I hardly understand it and haven't designed it :-). I'll try anyway:
-GenerateTileset(X,Y,Zoom) is called on line 412 and downloads data, calls the preprocessors
-l676 loops through all zoom levels, calling xml2svg(map-features.xml,$zoom.svg,$zoom)) on line 690
-l711 calls the real work horse RenderTile with a ton of parameters
-RenderTile is responsible for creating the png's and splitting them into 256x256 pieces. It takes the svg file for current layer and calls "svg2png" on a 256 pixel high "stripe" (y-tile) which it has been given as parameter. It will then call itself recursively for the next zoom layer for the "upper" and "lower" 256pixel stripes.
-svg2png is called with parameters y($Zoom, $ZOrig, $layer, $SizeX, $SizeY, $X1, $Y1, $X2, $Y2, $ImageHeight, $X, $Y, $Ytile)
Parameters:
$Zoom: Currently handled zoom level
$ZOrig: lowest zoom level (the difference between both gives an indication of how many tiles we need to split the result into.)
$layer: name of the layer (IIRC)
$SizeX, $SizeY: The png width/heigth that we want
$X1,Y1,X2,Y2: the coords in the SVG that we want to be exported (so we eg only render the current "stripe")
$ImageHeight: err, seems to be unused? if I am not mistaken
$X,Y: The tile XY coordinates (I think of the ZOrig zoom level)
$Ytile: The current Y stripe that we are handling...
I hope I got the above about right, feel free to correct me, I tried to stay away from that code as much as possible.
spaetz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/tilesathome/attachments/20071005/e2ed3ab2/attachment.pgp>
More information about the Tilesathome
mailing list