[OSM-dev] Best and FASTEST Spatial DB for only calculating points near to X?

Ian Dees ian.dees at gmail.com
Fri Dec 14 21:04:59 GMT 2012


On Fri, Dec 14, 2012 at 3:02 PM, Martin Schafran <martin at ampelmeter.com>wrote:

>
>
> > Thanks a lot for the advice. The query as I previously mentioned it would
> > be as simple as a "SELECT * FROM db WHERE X=X AND DISTANCE<5km". There
> > wouldn't be more type of queries.
> >
> >
>
> what happens if X=X matches the half database?
> a lot of comparisons.
>
> filter nodes by bbox
>
> WHERE ST_MakeBox2D(ST_GeomFromText(?, 4326), ST_GeomFromText(?, 4326)) &&
> n.geom
>
> statement.setString(1, lowerLeft.toString());
> statement.setString(2, upperRight.toString());
>
> and then
> DISTANCE<5km


http://postgis.refractions.net/docs/ST_DWithin.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20121214/3a544bfa/attachment.html>


More information about the dev mailing list