[OSM-dev] Spatial vs. multi-column indexes for points

Ian Dees ian.dees at gmail.com
Thu Sep 11 19:43:34 BST 2008


On Thu, Sep 11, 2008 at 1:31 PM, Andreas Kalsch <andreaskalsch at gmx.de>wrote:

> All, thanks for your quick responses!
>
> Quad tiles look like a smart way to create an index. So to lookup a single
> point or a quad tile, this is fine. But for my application I need another
> lookup - by bounding box with any ratio and size. Is there a way to look up
> a special bounding box with this index?


Take a look at the MySQL 5 documentation here:

http://dev.mysql.com/doc/refman/5.0/en/relations-on-geometry-mbr.html

When I was working on a read-only mirror of the OSM API, I created a
LINESTRING with the top left and bottom right as the end points. This
created a bounding box in MySQL that I could then use in one of the MBR
functions on that page.

Check out http://svn.yellowbkpk.com/geo/trunk/bbox.php to see the SQL
queries I was using. They aren't very good, but they'll show you how to use
the MBR stuff in MySQL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20080911/96cf9a5c/attachment.html>


More information about the dev mailing list