|
From: Natural R. D. <nr...@my...> - 2005-07-22 12:00:19
|
For those who've tried the NRDB Web demo, you may have noticed it taking quite a long time to display the image (compared to a few days ago). http://www.mypalawan.info/nrdb/temp/index.php Since PHP is interpreted its pretty slow at iterative loops (for, while, multiple calls to imageline). Whereas built in functions for handling blocks of data (like 'pack' and 'imagepolygon' are quite fast). I therefore intend to optimise how the polygons are stored in the database such that: - the centroid and extent may be pre-calculated and stored - the vertices are stored as arrays of integers (rather than run length encoded), so that they can be extracted with single function calls - the vertices are generalised to reduce the size of arrays (remove duplicate vertices that would relate to the same pixel when displayed) At present I'm just focussing on the database functions - the current mapping/interface is just for testing purposes. Richard |