Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to map a latitude/longitude to a distorted map?

Tags:

I have a bunch of latitude/longitude pairs that map to known x/y coordinates on a (geographically distorted) map.

Then I have one more latitude/longitude pair. I want to plot it on the map as best is possible. How do I go about doing this?

At first I decided to create a system of linear equations for the three nearest lat/long points and compute a transformation from these, but this doesn't work well at all. Since that's a linear system, I can't use more nearby points either.

You can't assume North is up: all you have is the existing lat/long->x/y mappings.

EDIT: it's not a Mercator projection, or anything like that. It's arbitrarily distorted for readability (think subway map). I want to use only the nearest 5 to 10 mappings so that distortion on other parts of the map doesn't affect the mapping I'm trying to compute.

Further, the entire map is in a very small geographical area so there's no need to worry about the globe--flat-earth assumptions are good enough.

like image 442
Adam Ernst Avatar asked Aug 05 '08 04:08

Adam Ernst


People also ask

How do you scale latitude and longitude?

However, the distance between a degree of longitude decreases from the equator to the poles. For any latitudinal position, you can determine the length, in miles, between degrees of longitude based on the formula: Distance covered by 1° of longitude (in miles) = cosine (latitude) x 69.172.

What is map projection map scale?

Map scale is defined as: The ratio of distance on a map to distance on the ground Map scale is generally expressed as a ratio, such as 1:100,000. This means that one unit on the map is equal to 100,000 units on the ground, or the map representation of a widget is 1/100,000th of the actual size of the widget.

Why do my latitude and longitude maps look distorted?

When you display maps based on latitude and longitude coordinates extending over a large region, they might appear somewhat distorted. This occurs because one degree of latitude is not equivalent to one degree of longitude. For example, consider a base map of the state of California (ca2010.gsb).

How do you find latitude and longitude on a map?

If you look at a map or globe, you’ll likely see lines running left to right and up and down. Latitude lines are the ones that run left to right (east to west), and longitude lines are the ones going up and down (north to south). Another way to look at it is that latitude is the x axis and longitude is the y axis.

What is the best latitude and longitude mapping software?

Maptive’s Mapping Software makes plotting latitude and longitude as easy as 1, 2, 3. With a few simple steps, you can map hundreds of locations in seconds and start gaining valuable insights about your data.

How do you find the coordinates down to the second?

Depending on the scale of the map, you may be able to estimate the coordinates of your point down to the second. Look at where your latitude and longitude lines intersect the coordinate lines on the edge of the map, and estimate the coordinates by their position relative to the closest graticules.


2 Answers

Are there any more specific details on the kind of distortion? If, for example, your latitudes and longitudes are "distorted" onto your 2D map using a Mercator projection, the conversion math is readily available.

If the map is distorted truly arbitrarily, there are lots of things you could try, but the simplest would probably be to compute a weighted average from your existing point mappings. Your weights could be the squared inverse of the x/y distance from your new point to each of your existing points.

Some pseudocode:

estimate-latitude-longitude (x, y)      numerator-latitude := 0     numerator-longitude := 0     denominator := 0      for each point,         deltaX := x - point.x         deltaY := y - point.y         distSq := deltaX * deltaX + deltaY * deltaY         weight := 1 / distSq          numerator-latitude += weight * point.latitude         numerator-longitude += weight * point.longitude         denominator += weight      return (numerator-latitude / denominator, numerator-longitude / denominator) 

This code will give a relatively simple approximation. If you can be more precise about the way the projection distorts the geographical coordinates, you can probably do much better.

like image 92
fastcall Avatar answered Sep 24 '22 08:09

fastcall


Alright. From a theoretical point of view, given that the distortion is "arbitrary", and any solution requires you to model this arbitrary distortion, you obviously can't get an "answer". However, any solution is going to involve imposing (usually implicitly) some model of the distortion that may or may not reflect the reality of the situation.

Since you seem to be most interested in models that presume some sort of local continuity of the distortion mapping, the most obvious choice is the one you've already tried: linear interpolaton between the nearest points. Going beyond that is going to require more sophisticated mathematical and numerical analysis knowledge.

You are incorrect, however, in presuming you cannot expand this to more points. You can by using a least-squared error approach. Find the linear answer that minimizes the error of the other points. This is probably the most straight-forward extension. In other words, take the 5 nearest points and try to come up with a linear approximation that minimizes the error of those points. And use that. I would try this next.

If that doesn't work, then the assumption of linearity over the area of N points is broken. At that point you'll need to upgrade to either a quadratic or cubic model. The math is going to get hectic at that point.

like image 27
Louis Brandy Avatar answered Sep 22 '22 08:09

Louis Brandy