我有一个随机坐标数组(经度和纬度),我想根据特定坐标按距离排序。谁能帮我 ?我在互联网上搜索,但我无法找到它。提前致谢。如何根据特定坐标的接近度对坐标数组进行排序
我使用下面的代码,但效率不高,因为我需要从最近的到farest每一个坐标:
var mapItens = ((from i in coordinatesArray
(latitudeCurrent > i.Latitude && ((latitudeCurrent - i.Latitude) < 0.700 || (longitudeCurrent - i.Longitude) < 0.700)) ||
(latitudeCurrent < i.Latitude && ((i.Latitude - latitudeCurrent) < 0.700 || (i.Longitude - longitudeCurrent) < 0.700)))
select i).toList();
发布您当前的代码...以便我们知道您在尝试使用什么 – Rahul
Hi @Rahul!谢谢你的回复,我刚刚更新了你的请求 –
我用这个[link]解决了我的问题(http://stackoverflow.com/a/12930598/2238515) –