[postgis-users] lat and long format

marco vieira maovieira at gmail.com
Wed Nov 22 03:17:25 PST 2006


Sunitha:
 Use a simple mathematical sentence like:

select (substring(lat from 1 for 2)::float+substring(lat from 4 for
2)::float/60.0+substring(lat from 7 for 2)::float/3600.0)*-1.0
from (
    select '17.21.00S'::text as lat
) as foo

 Be careful with the "seconds"  on sexagezimal sintax becouse you can have
data with more digits than 2 and use -1.0 product only in ocident (W) and
meridional hemisphere (S).

Regards,

-- 
Marco Vieira
+55 21 9499-6800
e-mail: maovieira at gmail.com

2006/11/21, Sunitha Bayana <sbayana at sidestep.com>:
>
>  Hi
>
>
>
>
>
>
>
> Is there any way in postgis to convert the lat and long from degree system
> to decimal system. I have the data in the format as below
>
>
>
>
>
>
>
> 17.21.00S
>
>
>
>
>
>
>
> 145.30.00W
>
>
>
>
>
>
>
>
>
>
>
>
>
> Thanks in advance.
>
>
>
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20061122/9c271cd0/attachment.html>


More information about the postgis-users mailing list