VBA写程序
各位大神有会用反距离加权插值法建立规则格网的吗,我已经将样点格网化处理了,不知道怎么将样点记录在每个格网中,或者用链数组,不知道有会的没http://bbs.mjtd.com/xwb/images/bgimg/icon_logo.png 该贴已经同步到 馨馨的微博 没看明白,是要用距离加权平均法计算网格点的属性值吗? gzxl 发表于 2016-5-6 12:13 static/image/common/back.gif
没看明白,是要用距离加权平均法计算网格点的属性值吗?
计算格网点的高程值,现在需要记录每个样点在哪个格网,不知道用什么方法,书上说设链数组,但是我看懂了不会写代码,感觉大神好像会,能不能给点思路提醒,那种方法容易些,谢谢啦 有没有人啊,求指点 馨馨 发表于 2016-5-6 22:27 static/image/common/back.gif
有没有人啊,求指点
用离网格点最近的几个点进行计算
下面是c++的 用距离加权平均法计算网格点的属性值的代码
// 用距离加权平均法计算网格点的属性值
AcGePoint3dArray CCFGWDLG::CalculateValueByJL(const AcGePoint3dArray &gridPts, const AcGePoint3dArray &gcdPts)
{
AcGePoint3dArray newgridPts;
int kk = gcdPts.length();
if (kk >= 10)
{
kk = 10;
}
for (int i = 0; i < gridPts.length(); i++)
{
AcGePoint2dArray distanceArray;
AcGePoint3d pt1 = gridPts;
for (int j = 0; j < gcdPts.length(); j++)
{
AcGePoint3d pt2 = gcdPts;
double dist = GetDistance(pt1.x, pt1.y, pt2.x, pt2.y);
AcGePoint2d temp((double)j, dist);
distanceArray.append(temp);
}
SortPointsOnY(distanceArray, 0, distanceArray.length() - 1);
double up = 0, down = 0, dz;
for (int k = 0; k < kk; k++)
{
AcGePoint2d temp = distanceArray;
int index = (int)temp.x;
double ptz = gcdPts.z;
double dis = distanceArray.y;
up += ptz / dis;
down += 1 / dis;
}
dz = up / down;
AcGePoint3d pt3d(pt1.x, pt1.y, dz);
newgridPts.append(pt3d);
}
return newgridPts;
}
gzxl 发表于 2016-5-6 23:40 static/image/common/back.gif
用离网格点最近的几个点进行计算
下面是c++的 用距离加权平均法计算网格点的属性值的代码
谢谢你 gzxl 发表于 2016-5-6 23:40 static/image/common/back.gif
用离网格点最近的几个点进行计算
下面是c++的 用距离加权平均法计算网格点的属性值的代码
谢谢你
非常感谢楼主提供分享!
页:
[1]