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

Stefan Keller sfkeller at gmail.com
Sun Dec 16 02:09:33 GMT 2012


Hi Ander

I would try PostGIS with the newest KNN index, limited to X first
results, and eventually also limited by an absolute distance criterion
(see ST_DWithin) or bbox, accelerated by a spatial index like this:

  SELECT ST_AsText(osm_poi.way) AS geom, name AS label
  FROM
    osm_poi,
    (SELECT ST_Transform(ST_GeomFromText('POINT(8.81638 47.22666)',
4326), 900913) AS way) AS mylocation
  WHERE ST_DWithin(osm_poi.way, mylocation.way, 20000)
  AND osm_poi.tags @> hstore('amenity', 'restaurant')
  ORDER BY osm_poi.way <-> mylocation.way
  LIMIT 100

(this query can be tested on my PostGIS Terminal.)

Yours, Stefan


2012/12/15 Jukka Rahkonen <jukka.rahkonen at latuviitta.fi>:
> Hi,
>
> Why not to put a good dataset available, let people run some tests with
> different databases and publish the results like in this clipping contest?
> http://gfoss.blogspot.it/2012/11/arcgis-vs-qgis-etc-clipping-contest.html
>
> Read also from the end of this message the warning about comparing apples
> with oranges
> https://www.gaia-gis.it/fossil/libspatialite/wiki?name=benchmark-4.0
>
> -Jukka Rahkonen-
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev



More information about the dev mailing list