Jump to content

 
Photo

Convert WGS84 (lat long) -> Robinson (x,y)

- - - - -

  • Please log in to reply
17 replies to this topic

#1
kamelito

kamelito

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • No Country Selected

Hi everybody,

I am getting a real headack trying to find information about that.

I have a map based on Robinson projection. I have to display on it cities, according to their latitude and longitude.
And no way to get information about the way to make the conversion in order to write my algorithm.

Does anyone have an idea ? a hint to help me with ?

#2
ProMapper

ProMapper

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 216 posts
  • Gender:Female
  • Location:India
  • Interests:promapper@gmail.com
  • India

If you have a map in Robinson projection but what is coordinate system, is it geographic? If so then use any GIS software and your geographic lat long points will sit where they belong.

Anu
http://www.mapsandlocations.com

#3
kamelito

kamelito

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • No Country Selected

sorry for the lack of details...

I think I have to convert them into Projected Coordinate System, according to the Robinson projection.

say, i bought my map on internet (this one : http://www.intercart...que-642-8.html# )

And I have my database with cities with lat and long, and the aim is to displays on a webpage the map, and cities.

thanks for your help.



If you have a map in Robinson projection but what is coordinate system, is it geographic? If so then use any GIS software and your geographic lat long points will sit where they belong.

Anu
http://www.mapsandlocations.com



#4
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,857 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

sorry for the lack of details...

I think I have to convert them into Projected Coordinate System, according to the Robinson projection.

say, i bought my map on internet (this one : http://www.intercart...que-642-8.html# )

And I have my database with cities with lat and long, and the aim is to displays on a webpage the map, and cities.

thanks for your help.


Since the Robinson map is supplied in PSD or EPS formats (both non-georeferenced) your best bet is to project your cities from WGS84 to Robinson in a GIS and then export it to the same format and size. Then it *should* overlay just fine. Note the emphasis on should, because Robinson is a bit of a tricky projection when it comes to how it's defined...

It would definately help if you'd create and export a graticule as well.

Are you looking to create a dynamic or static map?
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#5
kamelito

kamelito

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • No Country Selected

thanks for your reply Hans,

I want to create a dynamic map, I am trying to set this up in Flex.
so the aim is to be able to convert on the fly the coordinates, or to another way would be to convert all the lat/long in my data base of cities first.

would you recommend any software to convert the lat/long ?

by the way, what is a graticule ?



sorry for the lack of details...

I think I have to convert them into Projected Coordinate System, according to the Robinson projection.

say, i bought my map on internet (this one : http://www.intercart...que-642-8.html# )

And I have my database with cities with lat and long, and the aim is to displays on a webpage the map, and cities.

thanks for your help.


Since the Robinson map is supplied in PSD or EPS formats (both non-georeferenced) your best bet is to project your cities from WGS84 to Robinson in a GIS and then export it to the same format and size. Then it *should* overlay just fine. Note the emphasis on should, because Robinson is a bit of a tricky projection when it comes to how it's defined...

It would definately help if you'd create and export a graticule as well.

Are you looking to create a dynamic or static map?


Edited by kamelito, 23 April 2009 - 08:10 AM.


#6
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,857 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

thanks for your reply Hans,

I want to create a dynamic map, I am trying to set this up in Flex.
so the aim is to be able to convert on the fly the coordinates, or to another way would be to convert all the lat/long in my data base of cities first.

would you recommend any software to convert the lat/long ?

by the way, what is a graticule ?


If your cities aren't going to change very often, it's probabely best to convert them first. After all, in Flex you're probabely using screen or document coordinates rather than Robinson coordinates. I'm not too familiar with Flex myself (and it appears my trial for that has expired), but do you know whether it can import AI or EPS files? If so, I can take your list of cities, project them to Robinson, overlay them on that map and then save the whole lot in a layered AI file. SWF might be possible too.

Feel free to contact me privately if you want to give this a try.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#7
kamelito

kamelito

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • No Country Selected

thanks for your reply Hans,

I want to create a dynamic map, I am trying to set this up in Flex.
so the aim is to be able to convert on the fly the coordinates, or to another way would be to convert all the lat/long in my data base of cities first.

would you recommend any software to convert the lat/long ?

by the way, what is a graticule ?


If your cities aren't going to change very often, it's probabely best to convert them first. After all, in Flex you're probabely using screen or document coordinates rather than Robinson coordinates. I'm not too familiar with Flex myself (and it appears my trial for that has expired), but do you know whether it can import AI or EPS files? If so, I can take your list of cities, project them to Robinson, overlay them on that map and then save the whole lot in a layered AI file. SWF might be possible too.

Feel free to contact me privately if you want to give this a try.



Flex doesn't allow to import AI or EPS, but it allows SWF. So with llustrator I named each country layer of the map with the iso code of each country and exported it in swf.
So with Flex I can match them with the countries I have in my database, and manage each country shape (giving it a different color, drawing someting on it, etc...).

The map has a good enougth quality for the requirements of my project to be zoomed in even small countries like Belgium for example. So I the aim is to try to show as many cities as possible, keeping in mind my database contains more than a million of cities for the whole world.

This is why it would be a good solution to overlay the cities on the map, the swf file would too big and it would be to heavy to load and manage for the flash runtime.

I think it would be more suitable to create dots dynamically for each city when the map is displayed. And for this, the best would be to be able to convert the lat/long to x/y.


If not possible, your solution could fillfull partially my needs. Let's see !

#8
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,857 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Flex doesn't allow to import AI or EPS, but it allows SWF. So with llustrator I named each country layer of the map with the iso code of each country and exported it in swf.
So with Flex I can match them with the countries I have in my database, and manage each country shape (giving it a different color, drawing someting on it, etc...).

The map has a good enougth quality for the requirements of my project to be zoomed in even small countries like Belgium for example. So I the aim is to try to show as many cities as possible, keeping in mind my database contains more than a million of cities for the whole world.

This is why it would be a good solution to overlay the cities on the map, the swf file would too big and it would be to heavy to load and manage for the flash runtime.

I think it would be more suitable to create dots dynamically for each city when the map is displayed. And for this, the best would be to be able to convert the lat/long to x/y.


If not possible, your solution could fillfull partially my needs. Let's see !


Hmmmm... yeah, with a million+ cities a dynamic solution would be preferable, so my combine-the-lot-in-Illy idea isn't going to work.

So a WGS84 -> Robinson -> Document coordinates way would be best.

On a not unimportant note, have you considered the quality of your city data? I've done a fair bit of work in that field in the past and noticed that most, if not all, of the free sources are lacking in accuracy.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#9
kamelito

kamelito

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • No Country Selected

Flex doesn't allow to import AI or EPS, but it allows SWF. So with llustrator I named each country layer of the map with the iso code of each country and exported it in swf.
So with Flex I can match them with the countries I have in my database, and manage each country shape (giving it a different color, drawing someting on it, etc...).

The map has a good enougth quality for the requirements of my project to be zoomed in even small countries like Belgium for example. So I the aim is to try to show as many cities as possible, keeping in mind my database contains more than a million of cities for the whole world.

This is why it would be a good solution to overlay the cities on the map, the swf file would too big and it would be to heavy to load and manage for the flash runtime.

I think it would be more suitable to create dots dynamically for each city when the map is displayed. And for this, the best would be to be able to convert the lat/long to x/y.


If not possible, your solution could fillfull partially my needs. Let's see !


Hmmmm... yeah, with a million+ cities a dynamic solution would be preferable, so my combine-the-lot-in-Illy idea isn't going to work.

So a WGS84 -> Robinson -> Document coordinates way would be best.

On a not unimportant note, have you considered the quality of your city data? I've done a fair bit of work in that field in the past and noticed that most, if not all, of the free sources are lacking in accuracy.



The quality of the data seems to be good so far with google maps for example.

#10
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

The Generic Mapping Tools (GMT) (command mapproject) can be used to convert an ascii list of lat/lon coordinates to another ascii list in Robinson projection, in case this helps.
Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#11
kamelito

kamelito

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • No Country Selected

The Generic Mapping Tools (GMT) (command mapproject) can be used to convert an ascii list of lat/lon coordinates to another ascii list in Robinson projection, in case this helps.



Thanks for your reply.

I finally found information to create the algorithm. I will post it here as soon as I can !

#12
kamelito

kamelito

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • No Country Selected

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 :

http://findarticles....ag=content;col1

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 !

#13
Alastair Dant

Alastair Dant

    Newbie

  • New Member
  • Pip
  • 1 posts
  • United Kingdom

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 :

http://findarticles....ag=content;col1


hello there

i'm producing a Flash-based visualisation of site traffic for the Guardian and need to plot lat-long co-ordinates on a Robinson projection.

any chance you could share the AS3 source code for your completed mapping function?

we're happy to credit you in the final piece :)

best,
alastair

guardian news & media

#14
Nick H

Nick H

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 307 posts
  • Gender:Male
  • Location:Caversham, Reading, England.
  • United Kingdom

Hi kamelito,

At some stage I guess you'll need to georeference your map, so the following might be helpful:

Lat -75
Lon -165
Robinson x -10494299.9
Robinson y -7707438.1

Lat 75
Lon 165
Robinson x 10494299.9
Robinson y 7707438.1

If you have a point shapefile of world cities in WGS84 this could be projected to Robinson using the following Proj4 parameter string, see:

http://spatialrefere.../ref/esri/54030

+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

You could use ogr2ogr to project the WGS84 point shapefile. However, I've just done a quick check on the data above using QGIS, which appears to work, overlaying a georeferenced raster world map in the Robinson Projection with a WGS84 world borders shapefile projected on the fly in QGIS to Robinson. See attached (the green land masses are provided by the shape file).

Regards, N

Attached Files


Caversham, Reading, England.

#15
Nick H

Nick H

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 307 posts
  • Gender:Male
  • Location:Caversham, Reading, England.
  • United Kingdom

Just a quick follow-up to my previous post. As I mentioned, you can convert WGS84 shapefiles to Robinson shapefiles using ogr2ogr. An example command line that will do this is:

ogr2ogr -s_srs "EPSG:4326" -t_srs "+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" Cities_Robinson.shp Cities_WGS84.shp

ogr2ogr is part of 'FWtools' which can be downloaded from here (free):

http://fwtools.maptools.org/

What format is your cities database in? Is it a lat/lon shapefile, or in something like a lat/lon delimited text file?

Regards, N.
Caversham, Reading, England.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->