[postgis-users] Which length function should be used for linestrings

Raghavan Krishnasamylakshmanaperumal rkrish20 at uic.edu
Mon Apr 21 09:25:37 PDT 2014


Thanks Steve, then I hope ST_Length on the spheroid will be suitable for my
purpose.

Thanks,
Raghavan


On Mon, Apr 21, 2014 at 11:07 AM, Stephen Woodbridge <
woodbri at swoodbridge.com> wrote:

> On 4/21/2014 11:25 AM, Raghavan Krishnasamylakshmanaperumal wrote:
>
>> Hi All,
>>
>> I am trying to make use of linestring's length for one of my route
>> detection experiment.
>>
>> My linestring data is in this format
>> "the_geom geometry(LineString,4326)"
>>
>> I tried using ST_Length(the_geom), ST_Length(the_geom,true) and the
>> results are as follows,
>>
>>     */the_geom geometry(LineString,4326)/*
>>       "0102000020E6100000030000008204C58F31C551C070AC8BDB682C4540DA
>> 1B7C6132C551C0BF7D1D38672C45403333333333C551C00D4FAF94652C4540"
>>
>>     /*ST_Length(the_geom)
>>     */0.000141421356226931
>>
>>     *ST_Length(the_geom,true) *i.e spheroid=true
>>
>>     13.8305487635736
>>
>>
>>
>> What is the metric used for these st_length values? Also if I want to
>> use length as my edge cost in a graph formed out of these linestrings
>> which length function I should use?
>>
>
> ST_Length() returns the distance is the object units. In 4326 this would
> be degrees
>
> ST_Length on the spheriod is probably in meters.
>
> -Steve
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140421/3817b3d7/attachment.html>


More information about the postgis-users mailing list