我有一個點列表(實際上是商店座標),我需要確定它們是否位於特定邊界內。如何查找地理座標點是否在邊界內
在C#中我知道如何從緯度& LNG
var point = new GeoCoordinate(latitude, longitude);
創建一個點,但我怎麼能檢查,如果該點被包含在那些其他兩個點定義的矩形:
var swPoint = new GeoCoordinate(bounds.swlat, bounds.swlng);
var nePoint = new GeoCoordinate(bounds.nelat, bounds.nelng);
有沒有我可以使用的任何類方法?
難道你不能只檢查你的點的緯度/經度是> = sw點的緯度/經度和<=新點的緯度/經度? –
我們需要更多細節。您是否使用http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.geocoordinate或http://msdn.microsoft.com/en-us/library/system.device .location.geocoordinate.aspx? – philologon
是的,我正在使用System.Device.Location.GeoCoordinate,但如果這不是正確的解決方案,我可以使用其他的東西。 –