views:

8

answers:

0

My goal is to be able to open a web page on a mobile browser and, provided you are within the geographical bounds of the mapping area, plot your location on a stylized map image (PNG, JPG, whatever). Also on this map will be points of interest, and it would be nice to say "You're closest to XZY thing".

Is it sufficient to gather individual GPS coordinates for each POI? Do we need more than one? Would that improve accuracy (in theory, doesn't seem like it would, but in practice?).. Do we need to gather the "four corners" of the map in GPS, too? It seems that we'd need to calculate the edges of the map in order to know if you were in bounds, so the 4 corners would be nice (although it's possible not to be able to physically take a reading from each corner).

My feeling is that I'd need several data structures:

MapBounds( ImageX, ImageY, Lat, Lng ) - used to create a bounding-box for the mappable region

POI( ImageX, ImageY, Lat, Lng, Other, Descriptive, Attributes )

Now, when it comes time to draw the point on the map, we can do one of two things (or more?):

1) Calculate offsets from the MapBounds array and the mobile GPS coords

2) Determine three closest POIs, and use triangulation to calculate the location

It seems as if #1 can introduce subtle bugs (either due to rounding, or four-corner mapping imprecision) and that we really should be drawing relative to the closest POIs...

Thoughts? I am sure we are not the first to do this, but I can't find a well thought-out algorithm in the Google. This seems like a realm of software where naive implementations can be wayyy off the mark due to real-world inaccuracies/jitter/etc.

Thanks!!

related questions