Hi,<br><br>If the only thing you are interested in is asking for the amount of points within a given radius, I would strongly advise not to use a database, but quickly implement a dedicated data structure for that. That can usually be an order of magnitude faster than a general purpose database.<br>
<br>E.g. consider a simple KD-Tree [1]:<br><br>When doing you query you can simply stop recursion if the current block is completely within the given circle.<br>You can implement a KD-Tree in a really lightweight manner, completely implicitly. Just storing the coordinates, the KD-Tree structure is encoded in the ordering of them. You can have a look at an example [2]: Have a look at the function NearNeighbors, it could easily be modified to count the amount of points instead of returning them.<br>
<br>The only reason I could think of for using a database is, that you have to handle much more data than fits into memory. However, even in that case a specialized data structure should perform better - it's only more effort to implement :-)<br>
<br>Best regards,<br><br>Christian Vetter<br><br>[1]: <a href="http://en.wikipedia.org/wiki/K-d_tree">http://en.wikipedia.org/wiki/K-d_tree</a><br>[2]: <a href="http://code.google.com/p/monav/source/browse/plugins/osmimporter/statickdtree.h">http://code.google.com/p/monav/source/browse/plugins/osmimporter/statickdtree.h</a><br>
<br><div class="gmail_quote">On Fri, Dec 14, 2012 at 7:39 PM, Ander Pijoan <span dir="ltr"><<a href="mailto:ander.pijoan@deusto.es" target="_blank">ander.pijoan@deusto.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br><br>I am starting to develope an application that needs of a spatial database.<br><br>I'm almost sure that I will use PostGIS because it works great but taking into account that I will ONLY make querys to get a number of points near to another point and that what I most need is the answer to be fast, could there be another database system that might be more suitable for it?<br>

<br>I've seen that MongoDB has a spatial 2D index and I don't know if for the operations I'm going to do it could be faster than PostGIS.<br><br>I know that being a Friday afternoon it's a difficult question but can someone give me some advice about this?<br>

<br>Thank you very much.<span class="HOEnZb"><font color="#888888"><br clear="all"><br>-- <br><div><font color="#666666">Ander Pijoan Lamas<br>Research Assistant, Deustotech<br></font></div><div><font color="#666666">Computer Science Engineer<br>
</font></div><div>
<font color="#666666">University of Deusto<br><br></font></div><div><font color="#666666">E-mail: </font><a href="mailto:ander.pijoan@deusto.es" target="_blank"><font color="#666666">ander.pijoan@deusto.es</font></a></div>

<div><font color="#666666">Phone: <a href="tel:%2B34%20664471228" value="+34664471228" target="_blank">+34 664471228</a><br>in: <a href="http://www.linkedin.com/profile/view?id=162888312" target="_blank">http://www.linkedin.com/profile/view?id=162888312</a><br>
</font></div><br>
</font></span><br>_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/listinfo/dev" target="_blank">http://lists.openstreetmap.org/listinfo/dev</a><br>
<br></blockquote></div><br>