Hi,

My goal is to plot specific locations (most of them located in internatinoal waters) on a world map, using "spherical coordinates" stored in two variables (Latitude & Longitude) as shown bellow. I'd appreciate to know if there's an easier way than the one I propose below (or command that I'm not aware of) to a) either transform spherical coordinates to decimal degrees or use a specific command to plot spherical coordinates on a world map.

My spherical coordinates are stored as follows:
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str13 Latitude str14 Longitude
"15° 21.70' N" "52° 34.10' E" 
"30° 06.60' N" "47° 55.73' E" 
"13° 32.70' N" "49° 32.80' E" 
"30° 06.74' N" "47° 55.90' E" 
"4° 54.00' N"  "49° 21.00' E" 
"22° 10.86' N" "91° 47.06' E" 
"2° 53.00' S"  "107° 18.40' E"
"2° 58.00' S"  "107° 18.50' E"
"2° 52.20' S"  "107° 17.50' E"
"6° 01.30' N"  "3° 17.40' E"  
"2° 55.00' S"  "107° 18.00' E"
"3° 04.30' S"  "107° 17.20' E"
"3° 13.00' N"  "108° 45.00' E"
"9° 13.00' N"  "14° 06.20' W" 
"1° 23.50' N"  "104° 27.00' E"
"17° 52.90' N" "76° 46.60' W" 
"12° 55.20' N" "49° 36.60' E" 
"6° 01.00' S"  "106° 52.00' E"
"19° 04.00' N" "17° 09.00' W" 
"1° 13.80' N"  "103° 34.80' E"
"17° 52.70' N" "76° 46.60' W" 
"9° 16.70' N"  "14° 42.50' W" 
"1° 57.00' N"  "45° 31.00' E" 
"3° 10.20' S"  "106° 20.20' E"
"5° 52.20' S"  "106° 04.50' E"
"25° 40.00' N" "57° 04.00' E" 
"5° 53.28' S"  "106° 05.29' E"
"5° 28.70' S"  "105° 17.60' E"
"3° 18.50' N"  "112° 55.30' E"
"4° 55.42' N"  "98° 00.63' E" 
"4° 38.40' N"  "98° 12.80' E" 
"5° 17.00' N"  "98° 01.50' E" 
"10° 15.84' N" "64° 34.60' W" 
"10° 12.00' S" "112° 15.00' E"
"5° 16.00' S"  "106° 07.80' E"
"8° 45.90' S"  "13° 16.60' E" 
"5° 33.80' S"  "104° 37.00' E"
"24° 59.40' N" "59° 16.10' E" 
"24° 08.30' S" "46° 17.20' W" 
"9° 25.25' N"  "13° 44.30' W" 
"5° 36.50' N"  "0° 01.10' E"  
"6° 01.68' S"  "106° 53.84' E"
"22° 12.68' N" "91° 43.10' E" 
"6° 19.50' N"  "3° 25.00' E"  
"8° 29.80' N"  "13° 12.50' W" 
"22° 16.94' N" "91° 43.08' E" 
"1° 39.76' N"  "101° 38.30' E"
"24° 05.10' S" "46° 21.50' W" 
"24° 07.70' S" "46° 21.00' W" 
"24° 07.70' S" "46° 18.20' W" 
end
http://www.haghish.com/statistics/st.../nearstat.html proposes a formula to achieve the latter:
"
Spherical coordinates must be measured in decimal degrees. If your
coordinates are in a degrees, minutes, and seconds format, you can
convert them into decimal degrees using the following formula:


Decimal value = Degrees + (Minutes/60) + (Seconds/3600)


For instance, a latitude of 122 degrees 45 minutes 45 seconds north
is equal to 122.7625 degrees north.
"
Similarly, https://www.stata.com/manuals/spspdistance.pdf informs about a similar task, however, doesn't solve my task:

Array
In order to implement the above mentioned formula, I thought
Code:
split Latitude
split Latitude1, p(°) destring
split Latitude2, p(.) destring
gen minutes = (Latitude21/60)
format minutes %5.2g
split Latitude22, p(') destring
gen seconds = (Latitude221/3600)
which yields
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str13 Latitude str14 Longitude str4 Latitude1 str6 Latitude2 str1 Latitude3 byte(Latitude11 Latitude21) str3 Latitude22 float minutes byte Latitude221 float seconds
"15° 21.70' N" "52° 34.10' E"  "15°" "21.70'" "N" 15 21 "70'"        .35 70 .019444445
"30° 06.60' N" "47° 55.73' E"  "30°" "06.60'" "N" 30  6 "60'"         .1 60 .016666668
"13° 32.70' N" "49° 32.80' E"  "13°" "32.70'" "N" 13 32 "70'"  .53333336 70 .019444445
"30° 06.74' N" "47° 55.90' E"  "30°" "06.74'" "N" 30  6 "74'"         .1 74 .020555556
"4° 54.00' N"  "49° 21.00' E"  "4°"  "54.00'" "N"  4 54 "00'"         .9  0          0
"22° 10.86' N" "91° 47.06' E"  "22°" "10.86'" "N" 22 10 "86'"  .16666667 86  .02388889
"2° 53.00' S"  "107° 18.40' E" "2°"  "53.00'" "S"  2 53 "00'"   .8833333  0          0
"2° 58.00' S"  "107° 18.50' E" "2°"  "58.00'" "S"  2 58 "00'"   .9666666  0          0
"2° 52.20' S"  "107° 17.50' E" "2°"  "52.20'" "S"  2 52 "20'"   .8666667 20 .005555556
"6° 01.30' N"  "3° 17.40' E"   "6°"  "01.30'" "N"  6  1 "30'" .016666668 30 .008333334
"2° 55.00' S"  "107° 18.00' E" "2°"  "55.00'" "S"  2 55 "00'"   .9166667  0          0
"3° 04.30' S"  "107° 17.20' E" "3°"  "04.30'" "S"  3  4 "30'"  .06666667 30 .008333334
"3° 13.00' N"  "108° 45.00' E" "3°"  "13.00'" "N"  3 13 "00'"  .21666667  0          0
"9° 13.00' N"  "14° 06.20' W"  "9°"  "13.00'" "N"  9 13 "00'"  .21666667  0          0
"1° 23.50' N"  "104° 27.00' E" "1°"  "23.50'" "N"  1 23 "50'"   .3833333 50  .01388889
"17° 52.90' N" "76° 46.60' W"  "17°" "52.90'" "N" 17 52 "90'"   .8666667 90       .025
"12° 55.20' N" "49° 36.60' E"  "12°" "55.20'" "N" 12 55 "20'"   .9166667 20 .005555556
"6° 01.00' S"  "106° 52.00' E" "6°"  "01.00'" "S"  6  1 "00'" .016666668  0          0
"19° 04.00' N" "17° 09.00' W"  "19°" "04.00'" "N" 19  4 "00'"  .06666667  0          0
"1° 13.80' N"  "103° 34.80' E" "1°"  "13.80'" "N"  1 13 "80'"  .21666667 80  .02222222
"17° 52.70' N" "76° 46.60' W"  "17°" "52.70'" "N" 17 52 "70'"   .8666667 70 .019444445
"9° 16.70' N"  "14° 42.50' W"  "9°"  "16.70'" "N"  9 16 "70'"  .26666668 70 .019444445
"1° 57.00' N"  "45° 31.00' E"  "1°"  "57.00'" "N"  1 57 "00'"        .95  0          0
"3° 10.20' S"  "106° 20.20' E" "3°"  "10.20'" "S"  3 10 "20'"  .16666667 20 .005555556
"5° 52.20' S"  "106° 04.50' E" "5°"  "52.20'" "S"  5 52 "20'"   .8666667 20 .005555556
"25° 40.00' N" "57° 04.00' E"  "25°" "40.00'" "N" 25 40 "00'"   .6666667  0          0
"5° 53.28' S"  "106° 05.29' E" "5°"  "53.28'" "S"  5 53 "28'"   .8833333 28 .007777778
"5° 28.70' S"  "105° 17.60' E" "5°"  "28.70'" "S"  5 28 "70'"   .4666667 70 .019444445
"3° 18.50' N"  "112° 55.30' E" "3°"  "18.50'" "N"  3 18 "50'"         .3 50  .01388889
"4° 55.42' N"  "98° 00.63' E"  "4°"  "55.42'" "N"  4 55 "42'"   .9166667 42 .011666667
"4° 38.40' N"  "98° 12.80' E"  "4°"  "38.40'" "N"  4 38 "40'"   .6333333 40  .01111111
"5° 17.00' N"  "98° 01.50' E"  "5°"  "17.00'" "N"  5 17 "00'"  .28333333  0          0
"10° 15.84' N" "64° 34.60' W"  "10°" "15.84'" "N" 10 15 "84'"        .25 84 .023333333
"10° 12.00' S" "112° 15.00' E" "10°" "12.00'" "S" 10 12 "00'"         .2  0          0
"5° 16.00' S"  "106° 07.80' E" "5°"  "16.00'" "S"  5 16 "00'"  .26666668  0          0
"8° 45.90' S"  "13° 16.60' E"  "8°"  "45.90'" "S"  8 45 "90'"        .75 90       .025
"5° 33.80' S"  "104° 37.00' E" "5°"  "33.80'" "S"  5 33 "80'"        .55 80  .02222222
"24° 59.40' N" "59° 16.10' E"  "24°" "59.40'" "N" 24 59 "40'"   .9833333 40  .01111111
"24° 08.30' S" "46° 17.20' W"  "24°" "08.30'" "S" 24  8 "30'"  .13333334 30 .008333334
"9° 25.25' N"  "13° 44.30' W"  "9°"  "25.25'" "N"  9 25 "25'"   .4166667 25 .006944444
"5° 36.50' N"  "0° 01.10' E"   "5°"  "36.50'" "N"  5 36 "50'"         .6 50  .01388889
"6° 01.68' S"  "106° 53.84' E" "6°"  "01.68'" "S"  6  1 "68'" .016666668 68  .01888889
"22° 12.68' N" "91° 43.10' E"  "22°" "12.68'" "N" 22 12 "68'"         .2 68  .01888889
"6° 19.50' N"  "3° 25.00' E"   "6°"  "19.50'" "N"  6 19 "50'"   .3166667 50  .01388889
"8° 29.80' N"  "13° 12.50' W"  "8°"  "29.80'" "N"  8 29 "80'"   .4833333 80  .02222222
"22° 16.94' N" "91° 43.08' E"  "22°" "16.94'" "N" 22 16 "94'"  .26666668 94  .02611111
"1° 39.76' N"  "101° 38.30' E" "1°"  "39.76'" "N"  1 39 "76'"        .65 76  .02111111
"24° 05.10' S" "46° 21.50' W"  "24°" "05.10'" "S" 24  5 "10'"  .08333334 10 .002777778
"24° 07.70' S" "46° 21.00' W"  "24°" "07.70'" "S" 24  7 "70'"  .11666667 70 .019444445
"24° 07.70' S" "46° 18.20' W"  "24°" "07.70'" "S" 24  7 "70'"  .11666667 70 .019444445
end
The next step, which I have not done so far (and that might be suceptible to errors) would be to format vars. minutes & seconds as having two decimals only, join them together with var. Latitude 11 into one new variable and check whether Stata can plot that generated variable on a world map. I'm afraid these latter steps (and my whole appoach) might (best case scenario) plot wrong points, though.

I'd appreciate any comment on the matter.

Victor