A complete rewrite of the landwater system was required as Cloudmade decided to ditch their small users. I relied on their land/water image tiles for land collision in Ships.
Weeks of hard work wasted but one learns from that. Check out my post about cloud based software.
I was already thinking that text representation of area's might as well be vector based but it takes a lot of CPU power to test to see if a point is inside a complex polygon. If only it were possible to produce map tiles that had selfcontained polygons. Well, Michal Migurski was onto it well before me and already produced an online data source hosted on openstreetmap providing exactly the data in GEOJSON format.
The new vector based system is faster, just as accurate and uses less bandwidth. It is also comforting that the entire server solution is opensource so if needed I can build my own server.
server will serve the tiles from it's own MySQL database if possible and only if it is not there will it request the time from the openstreetmap server. The image shows how things go down. This solution should be super scalable while over time the data frequently used data will be cached in my server in MySQL
localStorage has a storage limit so my storage manager maintains a timestamp everytime a piece of data is requested. If the localstorage is full (There is only 5MB to play with) the oldest data will be deleted to make room for new data.
With this out of the way I press on to get Ships2 finished. My graphics designer is already giving it all a once over.