4

I have a csv with a list of the world sea ports and their coordinates.

The coordinates are in this format:

5234N 00226W

How can i convert this to decimal Latitude / Longitude ?

Data source

3
  • 1
    What program are you using? Please update your question with additional details. Also, where are you located? You indicate "world sea ports" so are these concentrated in one area, or all over the world?
    – GISHuman
    Commented Jun 3, 2014 at 12:56
  • I'm not using any particular software. I'm parsing a CSV file using C# code and want to convert to decimal Lat/Long before adding it to our database.
    – JCoder23
    Commented Jun 3, 2014 at 13:01
  • Do you know where those coordinates actually reference? At first glance it looks like hey converted the values by multiplying by 100 and dropping the remaining decimals.
    – dan_linder
    Commented Jun 4, 2014 at 2:29

2 Answers 2

10

Seems to be http://en.wikipedia.org/wiki/UN/LOCODE

Coordinate syntax explained in http://www.unece.org/fileadmin/DAM/cefact/locode/Service/LocodeColumn.htm#Coordinates

1.10 Column "Coordinates"

This column contains the geographical coordinates (latitude/longitude) of the location, if there is any.

In order to avoid unnecessary use of non-standard characters and space, the following standard presentation is used:

0000lat 00000long

(lat - Latitude: N or S ; long – Longitude: W or E, only one digit, capital letter) Where the last two rightmost digits refer to minutes and the first two or three digits refer to the degrees for latitude and longitude respectively. In addition, you must specify N or S for latitude and W or E for longitude, as appropriate.

2

I assume the data is in DDDMM format.

So you have to divide the value by 100, and the fractional part by 0.60 to get decimal degrees.

The result is inside England, but away from the shore:

enter image description here

At least the name Astley Abbots is right.

4
  • I would suspect because of not enough digits (which would then be converted to decimals).
    – Brad Nesom
    Commented Jun 3, 2014 at 13:12
  • Yes that was an unusual one, not sure why its in the data source. But for larger sea ports its seems to be accurate enough for my needs. Thanks !
    – JCoder23
    Commented Jun 3, 2014 at 13:30
  • Just so im clear, for example with the coordinates 5234N 00226W. Take the first part and I divide (5234 / 100) = 52.34 Then multiply the fractional part: .34 / .60 = .56 So the result will be Lat: 52.56 ? And do the same for the E/W ?
    – JCoder23
    Commented Jun 3, 2014 at 13:41
  • 2
    yes, + multiply by -1 for W and S when necessary
    – radouxju
    Commented Jun 3, 2014 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.