[postgis-devel] [PostGIS] #701: Support for 9.1 KNN GIST enhancements
PostGIS
trac at osgeo.org
Tue Oct 25 08:19:38 PDT 2011
#701: Support for 9.1 KNN GIST enhancements
-------------------------+--------------------------------------------------
Reporter: robe | Owner: pramsey
Type: enhancement | Status: new
Priority: medium | Milestone: PostGIS 2.0.0
Component: postgis | Version: trunk
Keywords: |
-------------------------+--------------------------------------------------
Comment(by markstos):
Thanks for your work on this, pramsey.
I currently use PostgreSQL to run over a million geo-spatial searches per
day for "points near a zipcode" using functions like "cube_distance()" and
"earth_box()". Below is an example of the kind of method I'm using. Is
your work a viable replacement for this use case? If it appears to be, I'm
happy to peer review the results vs my current method, and benchmark the
two alternatives.
Here's pseudo-SQL for our current use:
{{{
SELECT *
, cube_distance( center.earth_coords ,
postal_codes.earth_coords)/$meters_per_mi AS distance
, 'Miles' AS units
FROM (
SELECT
earth_coords,
earth_box( earth_coords , $radius*$meters_per_mi ) as
center_box
FROM zipcodes WHERE zipcode = '47374'
) as center,
addresses
JOIN zipcodes USING (zipcode)
ORDER BY distance ASC
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/701#comment:7>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list