math - Find all lat/long under certain radius -
math - Find all lat/long under certain radius -
i have set of lat/long stored in database , have find lat/long database lies between given lat/long(e.glatitude = 37.4224764,and longitude=-122.0842499
) , given radius(say 5miles).for need add-on , subtraction like:
37.4224764 + 5mile 37.4224764 - 5mile
,
-122.0842499+5mile -122.0842499-5mile
don't know how conversion works here.
you're little vague in requirements, want find out coordinates of point distance current location in given direction? or circle of radius of particular distance around coordinates? or draw line of length coordinates point particular distance away?
i assume you'd probabaly want utilize geometry spherical library, e.g.
var latlng = new google.maps.latlng(geometry.location.lat, geometry.location.lng); var newlatlng = google.maps.geometry.spherical.computeoffset( latlng, 1000, 0 );
see https://developers.google.com/maps/documentation/javascript/geometry#distance
ps: need add together geometry library parameter when loading map:
<script src="https://maps.googleapis.com/maps/api/js?v=3&libraries=geometry"></script>
math gps geospatial latitude-longitude spatial
Comments
Post a Comment