[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: RE: [postgis-users] Buffer Question
From: "Gustavo Henrique Sberze Ribas" <gribas () cpqd ! com ! br>
Date: 2005-07-27 12:48:42
Message-ID: E6F2049DCBE10840B22DC64587E6F3EC0DAF20 () MAILSRV1 ! aquarius ! cpqd ! com ! br
[Download RAW message or body]
Use setSRID():
Select *
from city
where setSRID(
buffer(
transform(GeomFromText('POINT(-98.20194 32.22056)',4269),2163),
100000
),
2163)
&&
transform(city.the_geom, 2163)
--
Gustavo
> 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.
>
> Jeff
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic