[OSM-dev] Proposal: Database accelerator and dirty tile marker based on simple algorithm.

Nicola Ranaldo ranaldo at unina.it
Wed Sep 20 12:37:02 BST 2006


> According to the docs there : "A B-tree index on spatial values will be
> useful for exact-value lookups, but not for range scans." - so using that
> for lat/lon addressing is likely to be bad.

a b-tree index, not an r-tree index!
howewer i suggest to take a look at postgresql r-indexes and spatial 
operators, they are a lot more advanced of the same in mysql.
Howewer the speedup is irrilevant as tile data are sparse in the db, and to 
recollect them you get a lot of page faults.
To compact them you have to take the tile data near, in the same db pages.
There are different solutions, howewer the simpler is to put all the tiles 
data in a single tuple, using arrays or a blob with a bitpacked format.
Tiles splitting or aggretation should be done where data is more or less then 
specified values (db block size?). A special table could be used to mark 
dirty bouding boxes. Whit this approach tiles size are not fixed and my vary 
upon density of objects, and you may reach the desidered precision without 
limits. A second id->tile index should be used to retrieve data by-id.
About zoom levels, this is an old question i repeated different times on the 
list, we need different  things here, a good model to establish wath objects 
are to be drawn at each zoom level, how they should be drawn, and different 
db layers to collapse them. A motorway should be drawn at very different zoom 
levels, so when you display an entire country you can have still a lot of 
segments/nodes to display. A special layer data should collapse all segments  
ending in the same minumum drawing unit (you should imagine it as a pixel), 
in a unique object, this as needed at different zoom ranges. So when you 
display data with zoom between 0 and 2 you query a table, when you display 
data with zoom between 3 and 4 you query another table and so on. Editing 
will be permitted only on the base layer, and api should propagate updates to 
upper layers. Some popular PDA softwares display this in real-time, and i 
suppose they use similiar techniques.

regards

	Niko











More information about the dev mailing list