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

2012-01-17 Thread Mike Toews
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  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
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


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

2012-01-17 Thread ZHAO Gorton
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
Traffic Management

T 02 9319 9431  F  02 9319 2015

http://www.scats.com.au

http://www.rmservices.nsw.gov.au



Roads and Maritime Services

2 Locomotive Street, Eveleigh NSW 2015




Before printing, please consider the environment

IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be 
read or used by the named addressee. It is confidential and may contain legally 
privileged information. No confidentiality or privilege is waived or lost by 
any mistaken transmission to you. Roads and Maritime Services (RMS) is not 
responsible for any unauthorised alterations to this e-mail or attachment to 
it. Views expressed in this message are those of the individual sender, and are 
not necessarily the views of RMS. If you receive this e-mail in error, please 
immediately delete it from your system and notify the sender. You must not 
disclose, copy or use any part of this e-mail if you are not the intended 
recipient.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users