[postgis-users] How does PostGIS know Units?

Paul Ramsey pramsey at refractions.net
Fri May 6 09:48:41 PDT 2005


Mark Fenbers wrote:

> Paul Ramsey wrote:
> 
>> Yes, PostGIS assumes all your units are the same. Which means that if 
>> you are working in degrees, buffer will also work in degrees. Which is 
>> probably not what you want. You will want to choose a planar 
>> projection to work in that is suitable to your data.
> 
> Great!  But how do I go about doing this?  Like I said, I'm still very 
> new to PostGIS?  Let's say my full SQL is:
>     select AsText( Buffer( PointFromText( 'POINT(39.0 -83.4)' ),125.0 ) );
> What should I do to choose a planar projection so that PostGIS 
> understands that my POINT is given in lat/lon and that Buffer() is using 
> km? 

You reproject your points *into* the planar projection, and then perform 
the calculation as before... what is the extent of your data? That will 
inform your choice of projection.

> And will I need the Proj4 module for this (in case I don't already 
> have it)?

Yes you'll need proj4. select postgis_full_version for a list of 
libraries (I think).





More information about the postgis-users mailing list