如何填补“漏洞”在不规则间隔的网格或数组中缺少数据?
有没有人有一个使用 Delaunay 填充网格的直接 Delphi 示例 三角形还是克里格法?任何一种方法都可以通过“插值”来填充网格。
我想做什么?我有一个网格,类似于:
22 23 xx 17 19 18 05
21 xx xx xx 17 18 07
22 24 xx xx 18 21 20
30 22 25 xx 22 20 19
28 xx 23 24 22 20 18
22 23 xx 17 23 15 08
21 29 30 22 22 17 09
其中 xx 代表没有数据的网格单元,每个单元的 x,y 坐标是 已知。克里金法和德劳内三角形都可以提供“缺失”点(当然,这些点是虚构的,但都是合理的值)。
克里金法是一种统计方法,用于填充“缺失”或不可用的数据 具有“合理”值的网格。你为什么需要它?主要是为了“勾勒”轮廓 数据。轮廓算法(例如 Delphi 的 CONREC http://local. wasp.uwa.edu.au/~pbourke/papers/conrec/index.html)可以绘制规则间隔数据的轮廓。谷歌搜索“kriging”和“Delphi”,您最终会被指向 Source Forge 上的 GEOBLOCK 项目 (http:// geoblock.sourceforge.net/ )。 Geoblock 有许多基于 GSLIB(斯坦福大学开发的 Fortran 统计包)的克里金法 Delphi pas 单位。然而,所有克里金/德劳尼单位都依赖于 Delphi 使用条款中引用的单位。不幸的是,这些“帮助”单元没有与其余源代码一起发布。似乎没有一个克里金单元可以独立运行,也不能在没有未发布的辅助单元或在某些情况下未定义的数据类型的情况下工作。
Delaunay 三角剖分 描述于 http://local.wasp.uwa.edu.au /~pbourke/papers/triangulate/index.html。发布的是 一个 Delphi 示例,非常简洁,可以生成“三角形”。不幸的是,我 不知道如何使用带有静态网格的装置。该示例动态“生成”一个数据字段。
有没有人让这些单元中的任何一个来填充不规则的数据网格?任何代码或提示如何使用现有代码来克里格一个简单的网格或使用 Delaunay 来填补漏洞将不胜感激。
Does anyone have a straight forward Delphi example of filling in a grid using Delaunay
Triangles or kriging? Either method can fill a grid by 'interpolating.'
What do I want to do? I have a grid, similar to:
22 23 xx 17 19 18 05
21 xx xx xx 17 18 07
22 24 xx xx 18 21 20
30 22 25 xx 22 20 19
28 xx 23 24 22 20 18
22 23 xx 17 23 15 08
21 29 30 22 22 17 09
where the xx's represent grids cells with no data and the x,y coordinates of each cell is
known. Both kriging and Delaunay Triangles can supply the 'missing' points (which of course, are fictitious, but reasonable values).
Kriging is a statistical method to fill in 'missing' or unavailable data in
a grid with 'reasonable' values. Why would you need it? Principly to 'contour' the
data. Contouring algorithms (like CONREC for Delphi http://local.wasp.uwa.edu.au/~pbourke/papers/conrec/index.html) can contour regularly spaced data. Google around for 'kriging' and 'Delphi' and you eventually are pointed to the GEOBLOCK project on Source Forge (http://geoblock.sourceforge.net/ ). Geoblock has numerous Delphi pas units for kriging based on GSLIB (a Fortran statistical package developed at Stanford). However all the kriging/delauney units are dependent on units refered to in the Delphi uses clause. Unfortunately, these 'helper' units are not posted with the rest of the source code. It appears none of the kriging units can stand alone or work without helper units that are not posted or in some cases, undefined data types.
Delaunay triangulation is described at
http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/index.html. Posted is
a Delphi example, pretty neat, that generates 'triangles.' Unfortunately, I
haven't a clue how to use the unit with a static grid. The example 'generates' a data field on the fly.
Has anyone got either of these units to work to fill an irregular data grid? Any code or hints how to use the existing code for kriging a simple grid or using Delaunay to fill in the holes would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我写这个作为答案,因为它太长,无法放入评论中。
假设您的网格确实是不规则的(您没有给出网格坐标的典型模式的示例),那么三角测量仅部分有帮助。一旦完成三角测量,您就可以使用该三角测量进行插值,并且可以做出不同的选择。
但你还没有说过你想如何插值,你想用插值做什么。
在我看来,您似乎要求提供一些代码,但不清楚您是否知道您想要什么算法。这确实是你应该问的问题。
例如,既然您似乎没有关于如何进行插值的标准,为什么不为缺失值选择最近的邻居。或者为什么不使用缺失值的总体平均值。这两个选择都满足您指定的所有标准,因为您没有指定任何标准!
真的,我认为你需要花更多的时间来解释你希望这个插值具有什么属性,你将用它做什么等等。我还认为你现在应该停止考虑代码并考虑算法。既然您提到了统计信息,您应该考虑在 https://stats.stackexchange.com/ 上询问。
I'm writing this as an answer because it's too long to fit into a comment.
Assuming your grid really is irregular (you give no examples of a typical pattern of grid coordinates), then triangulation only partially helps. Once you have triangulated you would then use that triangulation to do an interpolation, and there are different choices that could be made.
But you've not said anything about how you want to interpolate, what you want to do with that interpolation.
It seems to me that you have asked for some code, but it's not clear that you know what algorithm you want. That's really the question you should have asked.
For example since you appear to have no criteria for how you should do the interpolation, why don't you choose the nearest neighbour for your missing values. Or why don't you use the overall mean for the missing values. Both of these choices meet all the criteria you have specified since you haven't specified any!
Really I think you need to spend some more time explaining what properties you want this interpolation to have, what you are going to do with it etc. I also think you should stop thinking about code for now and think about algorithms. Since you have mentioned statistics you should consider asking at https://stats.stackexchange.com/.
Richard Winston 在 Embarcadero Developer Newwork Code Central 上发布的代码,标题为
( ID: 29365 ) 演示了生成约束 Delaunay 三角剖分以及根据任意位置的数据点绘制轮廓线的例程。 理查德的代码 。这些算法不会操纵和填充网格中的孔。它们确实提供了一种绘制任意数据轮廓的方法,并且不需要没有缺失值的网格。
我仍然没有在 Pascal 中找到可接受的克里格算法来实际
填补漏洞< /代码>在网格中。
Code posted by Richard Winston on the Embarcadero Developer Newwork Code Central titled
( ID: 29365 ) demonstrates routines for generating constrained Delaunay triangulations and for plotting contour lines based on data points at arbitrary locations. Richard's code . These algorithms do not manipulate and fill-in the holes in a grid. They do provide a method for contouring arbitrary data and do not require a grid without missing values.
I still have not found an acceptable krieging algorithm in Pascal to actually
fill-in the holes
in a grid.