核心问题是:如何在整个图像中插入与x / y坐标配对的4个纬度/经度值
为了便于解决这个问题,我们假设我的图像是静态的。
我有一个带有
图像的图片框我有一个针对此图片的地理编码标签文件,其中包含x / y对的纬度/经度对以及投影。
(-86.672304,36.132795) (443,30) Label "Pt 1",
(-86.672192,36.133032) (475,56) Label "Pt 2",
(-86.669807,36.13234) (286,290) Label "Pt 3",
(-86.670073,36.132034) (246,248) Label "Pt 4"
CoordSys Earth Projection 1, 104
Units "degree"
我试图找出如何获取这4个点并将每个像素的纬度/长度扩展到x / y转换。
我相信我现在需要做的就是应用某种规模。我可以计算二维平面上每个点之间的差值,但我不确定如何协调它。
我使用以下函数来确定点之间的距离
Private Function distanceBetweenPoints(ByRef pt1x As Double, ByRef pt1y As Double, ByRef pt2x As Double, ByRef pt2y As Double)
Dim p1x As Double = pt1x
Dim p1y As Double = pt1y
Dim p2x As Double = pt2x
Dim p2y As Double = pt2y
Dim pointDelta As Double
Dim xDiff As Double = (p2x - p1x) ^ 2
Dim yDiff As Double = (p2y - p1y) ^ 2
pointDelta = Math.Sqrt(xDiff + yDiff)
Return pointDelta
End Function
并按以下方式使用
delta1 = distanceBetweenPoints(pt1x, pt1y, pt2x, pt2y)
所以这将根据我的纬度和长度给出直线距离。
如果我对x / y像素执行相同操作,我应该能够获得像素距离,那么我应该能够将lat / long delta除以像素增量来获得每个像素的宽度。