javascript - Maps api geometry library for python -
using javascript google maps geometry apis, can compute coordinates of second point, giving coordinates of first point, distance required , angle. eg.
var point = new google.maps.latlng(55.623151, 8.48215); var spherical = google.maps.geometry.spherical; var north = spherical.computeoffset(point, 5000, 0); however, i'm working python google app engine , wondering how go doing in python , gae.
i've looked around python library same thing. don't want go grey trying reinvent wheel.
i solved using vincentydistance in geopy.
import geopy geopy.distance import vincentydistance import math lat1 = -27.413224 lng1 = 152.789183 angle = 90 //in degrees d = 50 //destination length required origin = geopy.point(lat1, lng1) destination = vincentydistance(meters=d).destination(origin, angle) lat2 = destination.latitude lng2 = destination.longitude
Comments
Post a Comment