[postgis-users] Buffer Question

Jeff Grice jgrice at predictioncompany.com
Wed Jul 27 05:27:49 PDT 2005

I am using PostgreSQL 8.0.3 on WindowsXP Professional and PostGIS
version 0.9.

I want to return a list of cities within a certain distance of a point. 

Note my city table is in srid=4269 which has units in degrees, so I must
transform it to srid=2163 to get to units in meters.

Select *
from city
where buffer(transform(GeomFromText('POINT(-98.20194
32.22056)',4269),2163), 100000) && 
transform(city.the_geom, 2163)

However when I run the buffer function I get 

ERROR: Operation on two GEOMETRIES with different SRIDs

I started dissecting the query and found the following:

Using SELECT transform(GeomFromText('POINT(-98.20194
32.22056)',4269),2163) I return:
	"SRID=2163;POINT(170540.337643801 -1435432.98097678)"

All is well; my srid = 2163 just as I would expect.

However, if I buffer the point with:
SELECT buffer(transform(GeomFromText('POINT(-98.20194
32.22056)',4269),2163), 10000)

My result returns srid = -1

How do I return a buffer result in srid=2163?

If I read the documentation correctly, the result should be in the same
spatial ref sys as the geometry passed in (in this case 2163).

Any help would be greatly appreciated.


More information about the postgis-users mailing list