[Routing] data-structures used
Marcus Wolschon
Marcus at Wolschon.biz
Fri Jan 25 05:21:47 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Brett Henderson schrieb:
| Marcus Wolschon wrote:
|> Hello everyone.
|>
|> What is everyone using for on-disk
|> and in-memory datastructures to store
|> the map locally for routing and map-rendering?
|>
|> I tried quite a number of ways including
|> using the osmosis-schema on mysql and later
|> hsqldb and currently a combination of a
|> hsqldb indexing name->id and id->tilenr
|> and one xml-file per tile seems to be the fastest
|> I could find. (Surprising as it seems that
|> this outperforms mysql with proper indice.)
|>
| How are you querying against that schema? Have you written custom
| queries to use the tile indexes?
Hello Brett,
I am having a memory-sentitive cache of the last
xml-files used. For routing I can query the hsqldb
to return the file-number and then ask a hashtable
in memory for that node/way/relation/waysContainingNode.
For painting I usualy need all ways/nodes of a bounding-
box and am first deciding on the level of detail
(1 complete map and 2 levels of a filtered and polygon-
simplified map stored) and then computing an iterator
of all file-numbers the bounding-box spans.
| Having said all that, it wouldn't surprise me if your approach is faster
| anyway. Do you compress the xml files, if so it is likely to be far
| more compact than many alternatives. On option to make the on-disk
| representation smaller may be to use the serialisation support in
| osmosis which writes a binary format to disk, but if you're compressing
| it probably won't make much difference.
I will definately try serialization instead of xml but
first timing-tests show the parsing-time to be neglectable.
So for the time being it's xml-files that are easier to work
with in debugging. (I can simply call josm on the directory to
see what has actally been stored.)
I do not compress the xml yet.
| Yeah, same problem with osmosis. I'm currently writing a customdb
| implementation but I'm not sure how well that will work at this point.
| It is read-only after creation so probably not suitable for your purposes.
It it is fast to query it may be suitable.
Free Map-updates are one of the major points for using osm here
but you can always overwrite parts of the local map completely
and not worry about deleted nodes and other diff-issues.
Marcus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHmXHqf1hPnk3Z0cQRApI6AJ9/vOUGEVpCTJCImmNXAy4kT9FevgCfQGlS
LlFji0yZ7VPBV9yINXa/flw=
=3/KZ
-----END PGP SIGNATURE-----
More information about the Routing
mailing list