简体   繁体   中英

How to estimate elevation based on sample set of elevations for other coordinates

Given a set of (x, y, z) points in 3D space, I want to be able to estimate the z for a new (x, y) pair.

For example: I am given a height map of a geographical feature, for example some hills in the countryside. That means that for some latitudes and longitudes, I know the elevation of the ground at that point. I would like to estimate the elevation of a person standing at (latitude, longitude) that is most likely not in the sample set.

How can I do that in Java?

I have already researched splines but am struggling to make any progress that way, and I also just tried using graphhopper's ElevationInterpolator but it gives clearly wrong results — it doesn't seem to give accurate estimations at all, unless the provided (lat, long) are in the sample set, then it is correct, but if it's just slightly offset it gives a wildly different elevation, and it gives the same elevation for all positions that aren't in the sample set.

In case you have elevations surrounding the point in question, the best way I can see would be to find a closest enclosing triangle or a quad and interpolate linearly between those. I don't think you can get much better than that.

In case you only have elevations on the side of a point, all you can do is assume it is relatively flat or maybe try calculating some sort of gradient from the points you have but basically that'll only be a wild guess.

Depending on how big an area you're covering, there's also a geoid that you might want to take into account.

As for your “intuitive” formula it uses too much data around the point in question so it will definitely produce wrong results. The fact of the matter is that the further points have nothing to do with elevation, all you need to estimate is the few closest ones and since you don't know anything about the surface anyway it doesn't really matter what the other points are. Well maybe unless you're into ML , then maybe you can get something out of them...

I found a MicrosphereInterpolator in Apache Commons

I guess this is actually a really hard problem and has no standard solution. This solution seems to be based on William Dudziak's 2007 MS thesis.

The MicrosphereInterpolator works well for me at the moment.

Other solutions I have tried, for example the intuitive formula , don't give intuitive results.

The only downside is that the MicrosphereInterpolator is quite slow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM