I have coordinates from the UNLOCATION dataset, that look like this: 4230N 00131E.
According to their site, this is how it should be processed: https://service.unece.org/trade/locode/Service/LocodeColumn.htm#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.
Is there a formula for converting this structure into a valid lat & long or a package that does that in Python?
As it seems that converting 4230N 00131E to 4230,00131 is not the correct solution.
Eventually I wrote this code: