Author |
Message |
23/07/2008 08:28:10
|
Molin
Joined: 23/07/2008 08:13:54
Messages: 2
Offline
|
Hi there!
Can someone tell me how to display lat and long on webservcie in deg min sec format.
For example:
I have in my table lat and long written in DEG format as a POINT in PostgreSQL.
45.603333 represent 45deg36min12sec
So, my POINT which represent some citiy is
(45.60333,16.771666)
How to display on webservice this point in this format:
45º36'12" 16º46'18"
Thanks for help!
|
|
|
23/07/2008 20:43:24
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
Hi Molin
It is simple mathematics. Multiply with 60 to get the minutes, mulitply the remainder again with 60 to get the seconds.
Best
Marc
|
|
|
|
23/07/2008 21:35:14
|
Molin
Joined: 23/07/2008 08:13:54
Messages: 2
Offline
|
Hi Marc,
my problem is not how to get deg min sec, but how to get symbols behind degrees (º), minutes (') and seconds ('') on the web.
I have in my table coordinates in DEG format (51.508333, 0.125277).This are the coordinates for London in table. Now, if I want to get coordinates of London in format degrees (º), minutes (') and seconds ('') on the web, what would my query have to look like.
For example, if I write:
select coordinates from cities where city='London';
I'll get this result
51.508333, 0.125277
and I would like to get something like this:
51° 30' 30'' 0° 7' 31''
Thank you for your time and help!
Molin
|
|
|
27/07/2008 10:01:51
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
As I said in my previous post. You have to do the calculation yourself. I don't know of any inbuilt database function to do this. If you don't want to do this on the application level you can write a stored procedure to do this for you on the database level.
Marc
|
|
|
|
|