neolithic All American 706 Posts user info edit post |
I have a map of the US of which I know the longitude and latitude of all 4 corners. What I want to do is to be able to plot a city based on its longitude and latitude, inside my program obviously. I'm having trouble finding a way to do this. Any ideas? 4/15/2008 12:56:33 AM |
darkone (\/) (;,,,;) (\/) 11610 Posts user info edit post |
What program and what format map (image, array, shapefile, etc...)? 4/15/2008 1:05:42 AM |
neolithic All American 706 Posts user info edit post |
The map is a .gif of the US and I'm writing the program myself. The problem is obviously the longitude and latitude lines bend, so I can't use an offset from one side of the map. 4/15/2008 1:15:42 AM |
qntmfred retired 40726 Posts user info edit post |
use math 4/15/2008 1:19:50 AM |
darkone (\/) (;,,,;) (\/) 11610 Posts user info edit post |
Do you know the projection of the map? 4/15/2008 1:20:00 AM |
neolithic All American 706 Posts user info edit post |
It doesn't really matter what map I use, so long as it is an image file of the US. So if you know one that is more conducive to this application, I'm all for it. What it really boils down to is I have a list of cities, their latitude and longitude, and I need to graph them in some algorithmic way. 4/15/2008 1:27:25 AM |
moron All American 34142 Posts user info edit post |
4/15/2008 2:01:35 AM |
DirtyMonkey All American 4269 Posts user info edit post |
this might come in handy: http://en.wikipedia.org/wiki/Haversine_formula 4/15/2008 2:08:01 AM |
darkone (\/) (;,,,;) (\/) 11610 Posts user info edit post |
^^^ Fine a map with a rectilinear projection so you can just use the offset from one side of the map. 4/15/2008 12:26:44 PM |
robster All American 3545 Posts user info edit post |
< HIJACKING THREAD >
Anyone know how to find the distance in feet between two points of long/lat
Thanks! 4/15/2008 1:51:02 PM |
darkone (\/) (;,,,;) (\/) 11610 Posts user info edit post |
^ http://jan.ucc.nau.edu/~cvm/latlongdist.html
I assume you can convert from miles to feet.
[Edited on April 15, 2008 at 2:00 PM. Reason : auto-link FTL] 4/15/2008 1:58:37 PM |
neolithic All American 706 Posts user info edit post |
^^^^ Any suggestions on where I can find a map like that? A google search for rectilinear projection map didn't yield anything useful. 4/15/2008 2:17:47 PM |
philihp All American 8349 Posts user info edit post |
^you could create one by transforming an existing map. 4/15/2008 2:52:12 PM |
neolithic All American 706 Posts user info edit post |
^Suggestions on how to start? I'm no cartographer. 4/15/2008 3:02:20 PM |
darkone (\/) (;,,,;) (\/) 11610 Posts user info edit post |
google image search: equirectangular
Otherwise, generate the map you need using ArcGIS.
[Edited on April 15, 2008 at 5:03 PM. Reason : more info] 4/15/2008 5:02:25 PM |
Noen All American 31346 Posts user info edit post |
I have some code that will do this at home. Used it for a mapping mashup for gmaps before they released a public API.
My method is a estimation function, but it's accurate to about 50ft and pretty fast for large data sets. It's in PHP, but that should be easily portable to whatever you are coding in. I'll try to remember it tonight when I get home. 4/15/2008 7:11:17 PM |
neolithic All American 706 Posts user info edit post |
That would be great. I really only need for it to get me in the right part of the state, as I'm graphing a point that represents a city. 4/15/2008 8:26:00 PM |
neolithic All American 706 Posts user info edit post |
^^^ Is this the correct type of map?
http://upload.wikimedia.org/wikipedia/commons/thumb/6/69/Usa-equidistant.png/800px-Usa-equidistant.png 4/15/2008 9:37:10 PM |
darkone (\/) (;,,,;) (\/) 11610 Posts user info edit post |
^ That's correct. It has the following bounds: 125° - 66° W, 50° - 24° N 4/15/2008 9:45:20 PM |
Shrike All American 9594 Posts user info edit post |
Now these points of data make a beautiful line 4/15/2008 9:48:06 PM |
neolithic All American 706 Posts user info edit post |
^^Excellent! I think this solves my problem then. Thanks a lot. I was beginning to get worried about this 4/15/2008 9:52:39 PM |
neolithic All American 706 Posts user info edit post |
In case you were wondering what I was trying to plot, it was the network topology of Level 3. Here it is if you want to see it:
http://www4.ncsu.edu/~albeam/topology.png
I know its nasty, but that is how it is supposed to look. 4/18/2008 2:41:12 AM |