简体   繁体   English

随机排列的坐标值的3D插值

[英]3D Interpolation of randomly arranged coordinate value

In a .NET/C# project I have relativley randomly arranged coordinates and assigned a weight KPI to each one of them like this: 在.NET / C#项目中,我相对地随机安排了坐标,并为每个坐标分配了权重KPI,如下所示:

Weight   | Lat       | Long
---------+-----------+-----------
1,123444 | 54,219367 | 9,696117
1,067940 | 51,950265 | 11,692274
1,054050 | 52,131392 | 13,216249
1,044820 | 52,636704 | 9,845077
1,023757 | 50,118346 | 7,308953
1,006427 | 53,612651 | 12,429595
1,002610 | 51,433237 | 7,661594
0,988619 | 49,396423 | 7,022961
0,955858 | 51,010989 | 10,845346
0,943669 | 50,652052 | 9,162438
0,938015 | 51,104541 | 13,201738
0,863415 | 48,790447 | 11,497889
0,835913 | 48,661604 | 9,350134

I am not an expert when it comes to mathematics or statistics. 在数学或统计学方面,我不是专家。 What I need to do is to interpolate any other given geo-coordinates weight based on the previously calculated ones (see above). 我需要做的是根据先前计算的值(见上文)对任何其他给定的地理坐标权重进行插值。

All the 3D-interpolation algorithms I found assume that the coordinates would have to be arranged in kind of a rectangular shape which is not possible in my szenario. 我发现的所有3D插值算法都假定坐标必须以矩形形状排列,这在我的szenario中是不可能的。

Are there any algorithms which would fit my need? 有没有适合我需要的算法? It might be helpful to point out, that we are using a bit of R.NET funktionality in the same project, so a solution using R would be perfectly fine. 需要指出的是,我们在同一项目中使用了一些R.NET功能,因此使用R的解决方案将是完美的。

There are different methods to do interpolation and they give you slightly different results. 插值方法有很多,它们给您带来略有不同的结果。 You should try a couple and see what works best for your scenario. 您应该尝试一下,看看哪种方法最适合您的方案。

One way to do it is take all the data points on a certain radius. 一种方法是将所有数据点放在一定的半径上。 Compute the distance to each, then compute a weighted average of their heights using he distance as the weight. 计算到每个对象的距离,然后使用距离作为权重计算它们的高度的加权平均值。 This will allow you to interpolate linearly between the points. 这将允许您在点之间进行线性插值。

If you want something a bit more wavy you can do the same but instead of using distance as weight, you use distance^2 or distance^3. 如果您想要一些更波浪的东西,可以执行相同的操作,但可以使用distance ^ 2或distance ^ 3代替重量作为重量。 This will give more weight to the closest point and make the surface more curved. 这将使最接近点的权重更大,并使曲面更弯曲。 You can even combine them to have something like a*distance^2 + b*distance but I would keep it as simple as possible. 您甚至可以将它们组合起来,使其具有a*distance^2 + b*distance但我会尽可能简化。

If you don't want to use a radius because of uneven distribution, you can take the closest K points (experiment with K and see what works best). 如果由于分布不均匀而不想使用半径,则可以获取最接近的K点(使用K进行实验,看看哪种方法最有效)。

These are all very generic but they work relatively well in a lot of cases. 这些都是非常通用的,但是它们在很多情况下都可以很好地工作。

Note: you can compute distance in 3D space if the points are relatively close, but if they are far away you should compute the distance over the sphere (the length of the arc). 注意:如果点相对较近,则可以计算3D空间中的距离,但是如果它们相距较远,则应计算球体上的距离(圆弧的长度)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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