[OSM-dev] OSM and MongoDB

Ian Dees ian.dees at gmail.com
Tue Apr 12 12:23:45 BST 2011


On Tue, Apr 12, 2011 at 1:43 AM, Frederik Ramm <frederik at remote.org> wrote:

> Hi,
>
>
> On 04/12/2011 02:58 AM, Ian Dees wrote:
>
>> The most recent dev version of MongoDB includes "multi-location
>> documents" support:
>>
>> http://www.mongodb.org/display/DOCS/Geospatial+Indexing#GeospatialIndexing-MultilocationDocuments
>>
>> This would allow a single way document to be indexed at multiple
>> locations and vastly speed up the map query.
>>
>
> It sounds to me that if one were to make extensive use of that feature, one
> would basically recreate the whole OSM database inside MongoDB's index
> structure. Before too long, you'll end up storing only "empty documents"
> because all the data you need has been migrated to the index in order to
> achieve decent performance ;)
>
> What's more, a linear object, in theory, has an infinite number of
> "locations"; without knowing the inner workings of MongoDB I must assume
> that choosing only a few of them for inclusion in the index might lead to
> the object being falsely omitted from some query results (just as we have it
> today when we only search for nodes inside a bounding box and thereby miss
> ways that intersect our box without having a node inside).


What I should have said was "This would allow a single way document to be
indexed at it's node's locations to vastly speed up the map query."

i.e. not just any arbitrary number of "locations" (yes, this would be silly
because there'd be an infinite number of "locations" for a way).

Performing the "nodes to ways" and "all nodes for those ways" queries are
what makes the map call slow, so finding a way to better index that would
help quite a bit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20110412/01b098d6/attachment.html>


More information about the dev mailing list