Convert WGS84 (lat long) -> Robinson (x,y)
Posted 10 January 2010 - 07:07 AM
Using proj it is possible to project a tab-delimited WGS84 lon/lat file to Robinson using a command line such as:
proj +proj=robin cities_lon_lat.txt > cities_robinson.txt
The input file ('robin cities_lon_lat.txt') needs to be tab-delimited in something like this format (lon first, then lat):
# Some World Cities
50.08 26.33 Ad Damman Saudi Arabia SAU
47.97 29.38 Kuwait Kuwait KWT
47.76 30.50 Basra Iraq IRQ
42.94 14.79 Al Hudaydah Yemen YEM
29.90 31.20 Alexandria Egypt EGY
Running the command above will produce a tab-delimited text file ('cities_robinson.txt'):
# Some World Cities
4589375.66 2816200.97 Ad Damman Saudi Arabia SAU
4359187.88 3142419.46 Kuwait Kuwait KWT
4324742.07 3261834.90 Basra Iraq IRQ
4017410.26 1581817.95 Al Hudaydah Yemen YEM
2701163.32 3336376.28 Alexandria Egypt EGY
In this example the output was sent to a text file, but of course it could be directed to anywhere you like. If the command above is run without the '> cities_robinson.txt' output will be to stdout (the terminal window).
Posted 22 July 2010 - 09:51 AM
so to convert dynamically the geographical coordinates (lat/long) to x/y value for a Robinson map, here is the mathematical explanation of the formulas :
note that in mathematique formulas, you always want to convert the lat/long from decimal value to radian before to apply on the any formula (it took me a week before to figure out that !!)
if you have any question about that, feel free to write, my map is displaying on the fly any city of the world !
quite an old post - but hoepfully I can still get some help! I'm trying to do something similar and I tried to translate lat/lon to x/y with Beineke's formula. Unluckily I don't have success doing so. I used radians - but maybe I'm missing something else. Which formula did you use? When you try to get y for 90° - shouldn't the result be 1, like propagated on Wikipedia? My result is -0,23.
Is Beineke's formula right? I found no other source in the web. It states here:
So the s would be always 1??
where s = 1 for ([phi][greater than or equal to]0) or s = 1 for ([phi]<0)
Edited by räph, 23 July 2010 - 03:42 AM.
Posted 26 July 2010 - 09:17 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users