Hello gurus,
I'm not sure if this is the best place to start with these questions, because they're really more related to mathematics, but I've got a good feeling y'all will help. Right now I'm really looking more for some input on how I'm planning to approach the problem rather than the code itself. I'd like to give people the opportunity to suggest alternatives before I pour my heart into this.... I have searched far and wide for similar questions/solutions, but nothing seems to fit quite right.
Here's the scenario:
I have a set of about 200 Lat/Long points each with an associated value of some magnitude, B. These points represent "stations" where data is collected.
The desire is for an end user to enter in any Lat/Long point, Pw, and have a value B returned that is interpolated from the known values....below is how I plan to interpolate this value:
1. Calculate the distances from each data point to Pw using the haversine formula
2. Define data points P1 and P2 as the two closest points to Pw
3. Define data point Pn as the next closest point that satisfies the criteria: Pw is in triangle P1P2Pn (note: I plan to use haversine distances for proximity, but lat long values to test that Pw is enveloped, is there anything wrong with that logic?)
4. Calculate the distances P1P2, P2P3, P1P3, P1Pw and P2Pw using the haversine formula
5. "flatten" the triangle (generate cartesian coordinates) that honor the distances calculated in step 4 (I think this skews distance P3Pw, not sure how problematic that is)
6. Now that my triangle is flat, and all points are located, use barycentric coordinates and interpolate B for Pw
How convoluted is this? Is there any accuracy to this? What would be the magnitude of error if all my data points are in the same state and I just used Lat/Long coords and jumped to barycentric coordinates?
My search for answers keeps leading me to dissertations and abstracts as if this is some unsolved paradox, but it seems like the answer should be simple... (simpler than my logic)
ANY help is appreciated, and I will post code as I write it once I get some feedback.
Thanks guys!
Bookmarks