我有兩個空間映射的值數據表,但一個表的坐標與第二個表的坐標不同。 我想“加入”這些表,但數據按坐標匹配,以便我可以比較兩個表之間的空間變化值。
有誰知道是否有一種簡單的方法可以做到這一點,而不僅僅是暴力計算每個值? 看起來有一些有趣的矩陣函數,但我不熟悉它們背後的數學概念。
我有一個如下所示的流程模型,希望能夠傳達我想要發生的事情。
查看更多... 多邊形佈局數據表是否規則且完整

Names Default To Here( 1 );
// Create the example data tables
New Table( "Data",
Add Rows( 4 ),
New Column( "x", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [0.5, 1.5, 0.5, 1.5] ) ),
New Column( "y", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [0.5, 0.5, 1.5, 1.5] ) )
);
New Table( "Layout",
Add Rows( 9 ),
New Column( "X", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [0, 1, 2, 0, 1, 2, 0, 1, 2] ) ),
New Column( "Y", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [0, 0, 0, 1, 1, 1, 2, 2, 2] ) ),
New Column( "V", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [0, 1, 2, 1, 2, 3, 2, 3, 4] ) ),
Set Row States( [8, 8, 8, 8, 8, 8, 8, 8, 8] ),
Set Label Columns( :V )
);
// Calculate the IV data
dtLookup = Data Table( "Layout" );
dtData = Data Table( "Data" );
dtData << New Column( "IV" );
For( i = 1, i <= N Rows( dtData ), i++,
xVal = dtData:X[i];
yVal = dtData:Y[i];
yMin = Col Max( If( dtLookup:Y < yVal, dtLookup:Y, . ) );
yMax = Col Min( If( dtLookup:Y > yVal, dtLookup:Y, . ) );
xMin = Col Max( If( dtLookup:X < xVal, dtLookup:X, . ) );
xMax = Col Min( If( dtLookup:X > xVal, dtLookup:X, . ) );
botLeft = dtLookup:V[(dtLookup << get rows where( :X == xMin & :Y == yMin ))[1]];
botRight = dtLookup:V[(dtLookup << get rows where( :X == xMax & :Y == yMin ))[1]];
topLeft = dtLookup:V[(dtLookup << get rows where( :X == xMin & :Y == yMax ))[1]];
topRight = dtLookup:V[(dtLookup << get rows where( :X == xMax & :Y == yMax ))[1]];
dtData:IV[i] = Mean( botLeft, botRight, topLeft, topRight );
);
IV 是表中 XYV(表 1)的插值,使用 XY(表 2)表中的坐標
我不明白你是如何得出 IV 的值的。您能解釋一下您正在使用的規則嗎?
我認為 VPTree() 或 Distance() 可以在這里工作(也許 KDTable()),但是你在領帶中做什麼?
如果我理解正確的話,不是尋找最近的點,而是尋找同一行中的點和插值。