Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
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? –  GISKid Jun 3 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 Jun 3 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 Jun 4 at 2:29

2 Answers 2

up vote 8 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
    
I would suspect because of not enough digits (which would then be converted to decimals). –  Brad Nesom Jun 3 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 Jun 3 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 Jun 3 at 13:41
1  
yes, + multiply by -1 for W and S when necessary –  radouxju Jun 3 at 14:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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