[postgis-users] help with ST_DWithin query

Vince Lotito vince at vvl.com
Wed May 5 09:46:01 PDT 2010


Hello,


I have a table of parcels and the projection is epsg 102728 (NAD_1983_StatePlane_Pennsylvania_North_FIPS_3701_Feet). I am trying to select certain parcels that are within 1 mile of the host parcel.  I select the centriod of the host parcels as follows:



SELECT ST_AsText(ST_Centroid(the_geom)) FROM public.pa42089_parcels WHERE rpd_property_id = 123456;


And with that centroid ( POINT(2611084.52017283 293875.803135596 ) I am doing the following:

SELECT gid, pin, ST_AsGML(the_geom) FROM public.pa42089_parcels WHERE ST_DWithin(the_geom,ST_GeomFromText('POINT(2611084.52017283 293875.803135596)'),5280.0) AND property_type ='Building' AND sale_date >= '05/05/2001' AND ( acreage >= 0.75 AND acreage <= 1.25 )
My results are not as expected, I am suspect of the centroid point as used in the ST_DWithing function (the wrong srid?) ... the mapped results (in openlayers) from this query show a concentration parcels in another area (not around the host parcel).

Any help would be greatly appreciated..

Vince
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100505/d43c801b/attachment.html>


More information about the postgis-users mailing list