Windows phone 7 无法通过windows phone计算以厘米为单位的距离

Windows phone 7 无法通过windows phone计算以厘米为单位的距离,windows-phone-7,geolocation,Windows Phone 7,Geolocation,我开发了一个应用程序来读取WindowsPhone7上两个位置之间的距离。但在测试应用程序时,每当我移动几厘米,它就会在13000年代开始产生价值 Public Sub watcher1_PositionChanged(sender As Object, e As GeoPositionChangedEventArgs(Of GeoCoordinate)) Dim dCoord As GeoCoordinate Dim currentDistance As Double

我开发了一个应用程序来读取WindowsPhone7上两个位置之间的距离。但在测试应用程序时,每当我移动几厘米,它就会在13000年代开始产生价值

    Public Sub watcher1_PositionChanged(sender As Object, e As GeoPositionChangedEventArgs(Of GeoCoordinate))
    Dim dCoord As GeoCoordinate
    Dim currentDistance As Double
    Dim convertedDistance As Double
    dCoord = New GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude)

    If mlastCoordinate.Latitude <> 0.0 Then

        'distanceText.Text = e.Position.Location.Latitude.ToString()
        currentDistance = mlastCoordinate.GetDistanceTo(dCoord)
        mDistance = startCoordinate.GetDistanceTo(dCoord)
        ' mDistance += currentDistance
        'mDistance = Math.Round(mDistance, 2)
        'Dim distance As String
        'distance = String.Format("%.2", mDistance)
        If selectedSystemState.Equals("centi") Then
            convertedDistance = mDistance * 100
        ElseIf selectedSystemState.Equals("meter") Then
            convertedDistance = mDistance
        ElseIf selectedSystemState.Equals("inches") Then
            convertedDistance = mDistance * 39.37
        ElseIf selectedSystemState.Equals("feet") Then
            convertedDistance = mDistance * 3.28
        End If

        convertedDistance = Math.Round(convertedDistance, 2)
Public Sub-watcher1\u位置已更改(发送方作为对象,e作为地理位置更改的数据源(地理坐标))
作为地理坐标的Dim-dcord
将当前距离设置为双精度
Dim CONVERTED距离为双精度
DCORD=新地理坐标(e.Position.Location.lation,e.Position.Location.Longitude)
如果MLAST坐标纬度为0.0,则
'distanceText.Text=e.Position.Location.Latitude.ToString()
currentDistance=mlastCoordinate.GetDistanceTo(DCORD)
mDistance=startCoordination.GetDistanceTo(DCORD)
'mDistance+=当前距离
'mDistance=Math.Round(mDistance,2)
“像弦一样模糊的距离
'距离=字符串.格式(“%.2”,mDistance)
如果选择SystemState.Equals(“厘”),则
convertedDistance=mDistance*100
否则,如果选择SystemState.Equals(“米”),则
convertedDistance=mDistance
否则,如果选择SystemState.Equals(“英寸”),则
转换距离=mDistance*39.37
如果选择了SystemState.Equals(“英尺”),则
转换距离=mDistance*3.28
如果结束
convertedDistance=数学圆(convertedDistance,2)

您所处的距离。因此,13000厘米等于130米——除非我们知道你移动什么和如何移动,否则这似乎是一个非常合理的值。

你是如何实例化定位服务的——如果你没有使用
GeoCoordinateWatcher(GeoPositionAccuracy.High)
你很可能会使用信元塔数据,它可能会偏离100米

即使你使用的是GPS,民用GPS装置的精度也只有5-10米左右,因此测量距离(厘米或英寸)实际上超出了这些范围

您可能应该检查
地理坐标.水平精度
,看看“噪音”可能是什么