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'm currently working on displaying twitter geo data (currently just long/lat -> cartesian without any analysis).

This is the world map (source: naturalearthdata): http://dl.dropbox.com/u/14747311/world.png

This is the rendered data: http://dl.dropbox.com/u/14747311/overlay.png. The mapping is done via mercator projection (with R = 1):

x = ((long + 180)/360)*x_dim
y = (y_dim/2) - ((arsinh(tan(lat))*(y_dim/2) (lat converted to radiant of course)

Now, the shape is apparent, but of course, the projections don't match. How can I fix that? (programming experience is plentiful, so it's more the theoretical side I'm concerned with).

share|improve this question
    
Are you writing everything from scratch? How did you render the world map? Both Naturalearthdata and Twitter POIs use lat/lon. –  underdark Aug 30 '11 at 21:01
1  
Have you tried rendering the twitter data over the naturalearthdata without projection? As @underdark says, the data is in lat/long originally. Also, have you tried rendering both sets of data through Mapnik as part of the same image? At worst you take the twitter data and turn it into a GeoJSON dataset and render through the OGR driver, or a CSV –  om_henners Aug 30 '11 at 23:50
2  
Lat/Long are really just x and y coordinates with a range -90<=Lat<=90 and -180<=Long<=180. The image may look distored from what you're used to seeing, but it would still work. (Also, technically, lat/long WGS84 is a cartesian projection based on geodetic data). The reason I suggest this is to make sure the data lines up in the first place - if not then you have to look at the data you're getting. If so then project as you wish. –  om_henners Aug 31 '11 at 0:42
2  
The world map certainly isn't in Mercator, but probably pseudo-Plate Carree (lat/lon just mapped as if they're linear units) or Plate Carree. Mercator stretches north-south, and you can see that the POIs are offset north and south versus the base map. –  mkennedy Aug 31 '11 at 18:52
1  
Femaref, @mkennedy has provided the diagnosis (your world map is not in a Mercator projection). The implied solution is to treat (lon, lat) as (x, y), scaled to your world map (this is the "Plate Carree" projection), and you should get a close match. No inverse hyperbolic sine functions are needed :-). –  whuber Aug 31 '11 at 20:54
show 5 more comments

2 Answers 2

up vote 0 down vote accepted

"The world map certainly isn't in Mercator, but probably pseudo-Plate Carree (lat/lon just mapped as if they're linear units) or Plate Carree. Mercator stretches north-south, and you can see that the POIs are offset north and south versus the base map." [mkennedy]

"@mkennedy has provided the diagnosis (your world map is not in a Mercator projection). The implied solution is to treat (lon, lat) as (x, y), scaled to your world map (this is the "Plate Carree" projection), and you should get a close match. No inverse hyperbolic sine functions are needed :-)." [whuber]

Note: This is a summary of comments by @mkennedy and @whuber, so this question can be marked as answered.

share|improve this answer
add comment

Trends Map works quite well from geotweets using the Twitter Geo API.

"We are currently processing around 30 million tweets per day. We have over 1000 cities from around the world that have their own page on the site (eg Melbourne), and the number of topics changes depending on what people are tweeting about."

Key to this is:

"Trendsmap uses a large volume of tweets and various algorithms to determine what is trending for a given location"

http://trendsmap.com/

share|improve this answer
1  
That's really fine and all for them but doesn't help me with my problem, considering my problem isn't the data or even twitter (the data could be anything, it just happends to be geodata from twitter as it is readily available), my problem is the projection. –  Femaref Aug 31 '11 at 16:03
    
but Lat/Lng is in WGS84 - this works with openlayers OpenLayers.Projection("EPSG:900913") Google Map OpenLayers.Projection("EPSG:4326") Twitter API –  Mapperz Aug 31 '11 at 17:02
add comment

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.