[postgis-users] decimal degrees -> miles?

Doug Nebert dn at mapcontext.com
Sun Aug 25 17:52:01 PDT 2002


Alex Rice wrote:
> Hi, does PostGIS have a function for converting decimal degrees to 
> miles? I'm using a -1 projection and my data is in decimal degrees.
> 

If you wish to calculate the distance in miles approximately
based on coordinate pairs in decimal degrees, the EPA has
been using this set of equations for years. Perhaps a method
could be added in postGIS to calculate the linestring distance
if the units are dd. It compensates for the fact that the
distance in longitude units converges towards the poles. It
will be most correct obviously for more detailed lines:

The equations below can be used compute the distance in miles
between two points (lat1/lon1 and lat2/lon2) that are expressed in
decimal degrees. You would have to sum the calculated segment
distances for the linestring.

disty = 68.98 * (lat1-lat2)
distx = 69.27 * cosine(lat2) * (lon1-lon2)
length = sqrt(disty*disty + distx*distx)

Doug.


> Thanks,
> 
> Alex Rice, Software Developer
> Architectural Research Consultants, Inc.
> alex_rice at arc.to
> alrice at swcp.com
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users







More information about the postgis-users mailing list