How can I get the latitude and longitude of “x” meter from ref latitude and longitude?

后端 未结 4 1668
自闭症患者
自闭症患者 2021-01-14 05:21

I have a distance in meters and ref latitude and longitude. Now I want latitude and longitude from the given ref point on x meters in four direction (south, north, east and

相关标签:
4条回答
  • 2021-01-14 06:00

    Javascript example:

    function translateCoordinates(distance, Lat,Lng, angle) {
        distanceNorth = Math.sin(angle) * distance;
        distanceEast = Math.cos(angle) * distance;
        earthRadius = 6371000;
        newLat = Lat + (distanceNorth / earthRadius) * 180 / Math.PI;
        newLon = Lng + (distanceEast / (earthRadius * Math.cos(newLat * 180 / Math.PI))) * 180 / Math.PI;
    
        return [newLat, newLon];
    }
    

    So you can convert it into c#

    • algorithm: https://gis.stackexchange.com/questions/2951/algorithm-for-offsetting-a-latitude-longitude-by-some-amount-of-meters
    • Java example - http://howrobotswork.wordpress.com/2013/05/20/how-to-add-distance-to-coordinates/
    0 讨论(0)
  • 2021-01-14 06:04

    This spreadsheet from the ordnance survey contains full conversions in vb script macro that can be converted.

    It should be able to give you the new location based on degrees and time.

    Reformat latitude and longitude coordinates between: Degrees, Minutes & Seconds; decimal Degrees; and Degrees & Decimal Minute formats.

    0 讨论(0)
  • 2021-01-14 06:09

    The other way to calculate this is to convert degree to radian: Pi radian is equals to 180 degree. The simple point about radian is the length on the circle (surface of Earth) is radius * radian. Thus, 1 degree * pi / 180 * 6360Km = 110.947Km where pi = 3.14.

    Latitude and longitude values move north-south and east-west respectively, so the above calculation could be mapped to those if the movement is along with their direction, otherwise sinus and cosinus functions must be used for mapping.

    0 讨论(0)
  • 2021-01-14 06:10

    How accurate does it have to be? You can often assume the earth is a sphere with a radius of 6360 km. In that case, one degree north or south is 10000/90 kilometers (that's how the meter was defined). East/West is only slightly harder, one degree east is 10000/90 km * cos(latitude).

    0 讨论(0)
提交回复
热议问题