我试图使用scipy.interpolate.interp1d绘制地图图像的经度和纬度值到x坐标和y坐标像素。我有样本值:
y = [0, 256, 512, 768, 1024, 1280, 1536]
lat = [615436414755, 615226949459, 615017342897, 614807595000, 614597705702, 614387674936, 614177502635]
x = [0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304]
lon = [235986328125, 236425781250, 236865234375, 237304687500, 237744140625, 238183593750, 238623046875, 239062500000, 239501953125, 239941406250]当我像这样传递函数时:
xInterpolation = interp1d(xDegree, xPixel)
yInterpolation = interp1d(yDegree, yPixel)
return (int(xInterpolation(lon)),int(yInterpolation(lat)))我得到了价值错误:
ValueError(“x_new中的A值高于插值”ValueError: x_new中的值高于插值范围)。
无论我尝试什么值,它都会抛出值错误,我甚至尝试给出输入列表中相同的lat或lon值,但这也不起作用。有人知道这里发生了什么吗?或者如果我用错了插值。
发布于 2016-09-27 21:02:26
https://stackoverflow.com/questions/39732724
复制相似问题