Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find the coordinates needed to draw the US in the Mercator projection?

So I'm writing a Javascript library that takes x,y coordinates and uses them to draw a map of the US. To do this, I need to find the coordinate data necessary to draw each state. This map on Wikipedia is a great example of what I need, because the SVG file contains the shapes that make up each state nicely labeled: http://upload.wikimedia.org/wikipedia/commons/3/32/Blank_US_Map.svg

I also have a set of sites which I need to place on this map. Since I know the latitude and longitude of each site, I can use that to draw each site in its appropriate place on the map. Unfortunately, for this to work my map needs to use the Mercator projection, so that there can be an easy mapping of lat,long to x,y pixel coordinates.

The Wikipedia map I mentioned above uses some other projection, so I can't use it for this purpose. Does anyone know where I can find this type of map data in the Mercator projection? Any data format is fine, so long as I can programmatically get at the coordinates which are used to draw each state and identify which shapes comprise each state.

like image 898
Eli Courtwright Avatar asked Feb 19 '10 18:02

Eli Courtwright


People also ask

How do you calculate Mercator projection?

The formula for Mercator's projection is T(ϕ, θ)=(θ, ln(|sec(ϕ) + tan(ϕ)|)). Of course, there are a huge number of map projections. Two more cylindrical projections are shown in figure 2.


1 Answers

Kevin McCurley has created some maps of the United States, including a map of all 50 states, in the Mercator projection. If you look at the source of that final link, it consists of (latitude, longitude) pairs for the outlines of the states, which are then transformed into (x, y) pairs for display in the svg format. His allowed usage is

Feel free to use these files in your own fun, but I would appreciate receiving credit for having created them. Enjoy...

I don't know if that's good enough for you.

like image 63
A. Rex Avatar answered Nov 11 '22 11:11

A. Rex