NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

latitude : 42.358372000000003 longitude : -8.8580850000000009

how can I convert to

Latitude: 42° 21' N Longitude: 8° 51' W ?? Any tools (js scripts, libraries..) ??

thanks!

asked 17 Jan '12, 18:32

afterbit's gravatar image

afterbit
11223
accept rate: 0%


A pocket calculator (computer, mobile phone, etc.) should do it. A minute is a sixtieth of a degree, so take the decimal part of the position in degrees and multiply it by 60 to convert it to minutes. Thus in the example that you gave, latitude 42.358372° becomes 42° (0.358372 x 60)', or 42°21.502'.

Next, you need to know that negative latitude means South of the equator, and negative longitude means West of the Greenwich meridian. That is simply a convention adopted by all geographers.

So your position becomes N42°21.502' W8°51.485'. That is the format most commonly used for navigation at sea, where it is useful because a minute of latitude is a nautical mile. The same format is used for geocaching.

You can, if you wish, convert the minutes to minutes and seconds in the same way, as a second is simply a sixtieth of a minute. Expressed in that way, the position that you used as an example is N42°21'30" W8°51'29".

It's in the coastal waters off North West Spain.

permanent link

answered 17 Jan '12, 22:30

Madryn's gravatar image

Madryn
2.2k365181
accept rate: 13%

edited 18 Jan '12, 01:20

Gnonthgol's gravatar image

Gnonthgol ♦
13.8k16103198

thank you very very much!!

(18 Jan '12, 09:18) afterbit

How hard could it be?

sLat = (lat -lat%1) + "° " + (lat%1)*60 + "' " + (lat>0?"N":"S")
sLon = (lon -lon%1) + "° " + (lon%1)*60 + "' " + (lon>0?"E":"W")

It is not like you need proj4js or anything when you are just converting the display style.

permanent link

answered 17 Jan '12, 21:01

Gnonthgol's gravatar image

Gnonthgol ♦
13.8k16103198
accept rate: 16%

wonderfull!

(18 Jan '12, 09:19) afterbit
1

On the other hand, proj4js will let you convert between quite a few weird local grids, so it's good to keep in mind.

(18 Jan '12, 10:33) Vincent de P... ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1

question asked: 17 Jan '12, 18:32

question was seen: 3,958 times

last updated: 02 Feb '12, 10:31

Related questions

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum