[postgis-users] distance in miles

P Kishor punkish at eidesis.org
Sun Feb 18 09:17:57 PST 2007


On 2/18/07, mark <rkmr.em at gmail.com> wrote:
> On 2/18/07, P Kishor <punkish at eidesis.org> wrote:
> > On 2/18/07, mark <rkmr.em at gmail.com> wrote:
> > > Which SRID should I use to transform geometry to get distance in
> > > miles? RIght now I am using the SRID 26986 which is giving the
> > > distance in metres.
> > why not just multiply the answer by 0.000621371
>
> This is my query. Can you tell how I can multiply this here:
>
> SELECT *, distance(transform(pt_geometry,26986),
> transform(geometryfromtext('POINT(-79.893490 40.068770)', 4269),
> 26986))

SELECT *, (distance(transform(pt_geometry,26986),
transform(geometryfromtext('POINT(-79.893490 40.068770)', 4269),
26986))) * 0.000621371) AS distance
FROM mytable

-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
---------------------------------------------------------------------
collaborate, communicate, compete
=====================================================================



More information about the postgis-users mailing list