forerunnerdb

Determine if a Longitude & Latitude Co-ordinate is Inside a Radius in Miles and Kilometers

大城市里の小女人 提交于 2019-12-23 03:07:31
问题 Using only pseudo-code or JavaScript, can anyone describe the best way to determine which items in array of objects composed of: { "lat": float, "lng": float } are within a given radius in either miles or kilometers? I am adding geo-location-based queries to ForerunnerDB (https://github.com/irrelon/ForerunnerDB) and would like to be able to produce fast results from the search. Bonus points if you can describe an indexing strategy that will speed up the query over the array. I have written