Hi all...
I just committed a prototype on-demand tile rendering CGI script
(get-tile.pl). The idea is to fill a database with primitives first
(the fast step), and only render the tiles as the client requests them
(the slow step).
The script requires an htaccess Apache config file (provided), placed
in the same directory as your "tileinfo.xml" file, that launches the
CGI only when a tile file can't be found. So the client doesn't
care/doesn't even have to know whether the tile is rendered or not -
if a tile is on disk, it is returned, if not, the CGI script renders
and returns it (also saving it to disk for next time). Thanks to
Mitch for the suggestion of doing it this way.
This is just a rough prototype and could be optimized and improved a
LOT ("grep -i todo get-tile.pl" to see how). A major problem with it
right now is that it fails to render GD::Font primitives on the fly.
On some machines, rendering a GD::Font causes GD to crash when
rendering the PNG. On other machines, you get weird output like this:
http://biowiki.org/~avu/badtile.png
This is for the demo volvox database from the GBrowse tutorial:
http://www.gmod.org/nondrupal/tutorial/tutorial.html
which makes it seem pretty clear why GD is crashing... but I'm not
sure where those refs are failing to be deferenced.
Now I know that GD::Font primitives are being stored and recalled
correctly. For example, if I run generate-tiles.pl with "-m 1" to
fill the database ONLY, then later run it with "-m 2" to render tiles
based on a prior fill, they render just fine. It is something about
how the CGI restores them that's a problem.
I've tried to debug it with no success... alas, I'm pressed for time
and can't really finish the job right... so I'm turning in what I have
and leaving this on the back burner for now, but if anyone wants to
take a stab at it, it would be welcome.
Andrew
|