[postgis-users] Re: Newbie questions on what geometry to use

Stephen Woodbridge woodbri at swoodbridge.com
Mon Jul 3 20:30:59 PDT 2006


Chris,

This should be very fast, just make sure the geometry column has GIST 
index on it and that you vacuum analyze the table.

You will need to adjust the example below so that you are using the same 
srid as your geometry and you point will need to be specified by lat/lon 
and distance and the expand will be in degrees depending on the accuracy 
you need, you can either approximate the the distance as degrees, but 
read the archives on the pros and cons of this. Or you can project you 
points into UTM projection and get a more accurate result.

-Steve W

snacktime wrote:
> I think I found the best solution to my problem.  Set a bounding box
> on the point I am searching from in conjunction with Distance.  Like
> so (I found this in another post):
> 
> SELECT AsText(geom) FROM point_table
> WHERE
>  geom && Expand(GeometryFromText('POINT(10000 20000)',2769),900)
> AND
>  Distance(geom,GeometryFromText('POINT(10000 20000)',2769) < 900
> 
> 
> How efficient would something like that be against say 5000 rows?
> 
> Chris
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 




More information about the postgis-users mailing list