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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -