[postgis-users] ST_Buffer questions

Ben Madin lists at remoteinformation.com.au
Wed Mar 31 22:41:36 PDT 2010


G'day Li,

I can't help with Q2, but

On 01/04/2010, at 12:28 , Chen, Li [Contractor] wrote:

> Q1.
> ST_Buffer(g1, range) is able to return a geometry within the range of g1.
>  
> So, I define two point using lon/lat (SRID=4326) and range 10km. I want to see whether they cross each other by using ST_Crosses(g1, g2).
> However, I don’t know the unit of the range parameter in ST_Buffer(g1,range)  as it is not provide in the docs. So is it km or meters?

The same unit as your Geometry - decimal degrees. Obviously due to the change in the value of this unit at differing latitudes, this is not useful, so a more sensible approach is either to transform your point into a projection using metres, and then use metres

 (off the top of my head it would look like :

select st_buffer(st_transform(g1, appropriate_projection_epsg),10000);

but you should check the docs)

or use the geography type from postgis 1.5? but I haven't tried it yet?

cheers

Ben




More information about the postgis-users mailing list