[postgis-users] radius of buffer parameter issue at st_buffer function...

Mike Toews mwtoews at gmail.com
Tue Jan 17 16:41:59 PST 2012


Are you sure your coordinates are projected? Could you get an example
EWKT from you dataset using:

SELECT ST_AsEWKT(geom)
FROM mytable LIMIT 1;

If you are seeing something like POINT(147.65625 -33.046875), which
has linear units of degrees (not metres), then you need to properly
set the SRID and transform them:

SELECT ST_AsEWKT(ST_Transform(ST_SetSRID(ST_geom, 4326), 3308))
FROM  mytable LIMIT 1;

Note: I'm only guessing 4326 for WGS84, but your data could use a
different datum.

If your geometries are indeed projected, and the linear distances make
sense, make sure your geometries are valid:

SELECT * FROM mytable
WHERE NOT ST_IsValid(geom);

Invalid geometries cause havoc with some operations.

-Mike

On 18 January 2012 12:45, ZHAO Gorton <Gorton.ZHAO at rms.nsw.gov.au> wrote:
> I am using postgis 1.5 and use the st_buffer function with my spatial queries. I have set the srid to 3308 for my spatial data which the measurement unit is meter, but when I use the st_buffer function and set the radius of buffer in meter. The spatial queries return far more rows than what I expected. The measurement unit of radius of buffer in st_buffer function does not seem to me to be in meter. Instead of using 10 for a radius of 10 meters, I have to use a value of 10*1.7453292519943283E-5 instead. What could be the problem with this st_buffer function? I do not mind to use this value but it is not what postgis documented. It would be appreciated if you could help on this.
>
> Regards,
>
> Gorton ZHAO



More information about the postgis-users mailing list