[postgis-users] Setting Units in PostGIS

Craig Miller craig.miller at spatialminds.com
Mon May 2 16:57:30 PDT 2005


 

If area is being measured, I'd suggest you select an equal-area projection
as well.

 

--Craig

 

  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Gustavo
Henrique Sberze Ribas
Sent: Monday, May 02, 2005 4:11 PM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] Setting Units in PostGIS

 

Hello, 

 Like Markus said, if you apply area() to coordinates in lat/long you'll 
get a result in degrees^2... Not only is it hard to imagine but it's 
also wrong, since you're applying 2D planar formulas to an ellipsoidal
coordinate system. 

 If your coordinates are in a carthesian system you're done, just 
convert the result to the unit you like most. 

 If not you'll have to project your coordinates on a plane in order 
to apply the desired formulas. That's not as difficult as it sounds, 
PostGIS will do most of the hard work for you. For example, you 
could translate all your coordinates to UTM (unit=meters), apply 
area() and then multiply the result by the proper factor 
(1000 meters = 0.621371192 miles). 

 Of course, If you truly like precision and math you could try to 
deduce an area formula for an ellipsoidal system... :) 

 

-- 
Gustavo 

>> I'm a newby to PostGIS and have what I believe is a simple question. 
>> How do I determine what units PostGIS is returning?  When I calculate 
>> the area of a polygon or the distance of a line segment, how can I set 
>> it to return Square Miles or miles or feet? 
>> Any help would be greatly appreciated. 

>That completely depends on the units your data is measured in. If your 
>data coordinates are in a carthesian system, then distances are the same 
>units as the coordinate units, and areas are the squared unit. 

>If your data coordinates are in lat/long or something else, then 
>distance and area calculations are rather unusable, you will need 
>something like distance_sphere() then. 

>Markus 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050502/776648f9/attachment.html>


More information about the postgis-users mailing list