<div class="gmail_quote">On Tue, Apr 12, 2011 at 1:43 AM, Frederik Ramm <span dir="ltr"><<a href="mailto:frederik@remote.org">frederik@remote.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<div class="im"><br>
<br>
On 04/12/2011 02:58 AM, Ian Dees wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The most recent dev version of MongoDB includes "multi-location<br>
documents" support:<br>
<a href="http://www.mongodb.org/display/DOCS/Geospatial+Indexing#GeospatialIndexing-MultilocationDocuments" target="_blank">http://www.mongodb.org/display/DOCS/Geospatial+Indexing#GeospatialIndexing-MultilocationDocuments</a><br>
<br>
This would allow a single way document to be indexed at multiple<br>
locations and vastly speed up the map query.<br>
</blockquote>
<br></div>
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 ;)<br>
<br>
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).</blockquote>
<div><br></div><div>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."</div><div><br></div><div>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).</div>
<div><br></div><div>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. </div></div>