public static List<CLSCOBO_BasePoint> GeoPoints(string ps_Address, string ps_Key) { XmlDocument vo_Xml = new XmlDocument(); vo_Xml.LoadXml(GetXml(ps_Address, ps_Key)); XmlNodeList vo_Response = vo_Xml.GetElementsByTagName("Response"); XmlNodeList vo_Placemarks =((XmlElement)vo_Response[0]).GetElementsByTagName("Placemark"); List<CLSCOBO_BasePoint> vo_BasePoints = new List<CLSCOBO_BasePoint>(); //int i = 0; foreach (XmlElement vo_Node in vo_Placemarks){ try { XmlNodeList vo_Point = vo_Node.GetElementsByTagName("Point"); XmlNodeList vo_Address = vo_Node.GetElementsByTagName("address"); CLSCOBO_BasePoint vo_BasePoint = new CLSCOBO_BasePoint(); vo_BasePoint.Longitude = Convert.ToDouble(vo_Point[0].InnerText.Split(new char[] { ',' })[0]); vo_BasePoint.Latitude = Convert.ToDouble(vo_Point[0].InnerText.Split(new char[] { ',' })[1]); vo_BasePoint.ZipCode = vo_Address[0].InnerText; vo_BasePoints.Add(vo_BasePoint); } catch { } } return vo_BasePoints; }
public static string CreateTag(CLSCOBO_BasePoint po_BasePoint) { string vs_Tag=""; vs_Tag="Zip Code: "+po_BasePoint.ZipCode+Environment.NewLine+ "Latitude: "+po_BasePoint.Latitude.ToString()+Environment.NewLine+ "Longitude: "+po_BasePoint.Longitude.ToString(); return vs_Tag; }
public static int CalculateCuadrant(CLSCOBO_BasePoint po_FromPoint, CLSCOBO_BasePoint po_ToPoint) { int vi_Quadrant=0; if(po_ToPoint.Latitude>po_FromPoint.Latitude&& po_ToPoint.Longitude<po_FromPoint.Longitude) { vi_Quadrant=1; }else if(po_ToPoint.Latitude>po_FromPoint.Latitude&& po_ToPoint.Longitude>po_FromPoint.Longitude) { vi_Quadrant=2; }else if(po_ToPoint.Latitude<po_FromPoint.Latitude&& po_ToPoint.Longitude<po_FromPoint.Longitude) { vi_Quadrant=3; }else if(po_ToPoint.Latitude<po_FromPoint.Latitude&& po_ToPoint.Longitude>po_FromPoint.Longitude) { vi_Quadrant=4; } return vi_Quadrant; }
public void Refresh() { ao_BasePoint = new CLSCOBO_BasePoint(asZipCode); }
public CLSCODF_Test() { ao_BasePoint = new CLSCOBO_BasePoint(); }
private bool IsSameQuadrant(CLSCOBO_BasePoint po_OriginPoint, CLSCOBO_DeliveryPoint po_DeliveryPointFrom, CLSCOBO_DeliveryPoint po_DeliveryPointTo) { bool vb_SameQuadrant; if(CLSCOBO_FunctionsRepository.CalculateCuadrant(po_OriginPoint,po_DeliveryPointFrom)==CLSCOBO_FunctionsRepository.CalculateCuadrant(po_OriginPoint,po_DeliveryPointTo)) vb_SameQuadrant=true; else vb_SameQuadrant=false; return vb_SameQuadrant; }
public static int getDistance(CLSCOBO_BasePoint po_OriginPoint, CLSCOBO_BasePoint po_DestinationPoint) { double vd_Distance = CLSCOBO_FunctionsRepository.getDistance(po_OriginPoint.Longitude, po_OriginPoint.Latitude, po_DestinationPoint.Longitude, po_DestinationPoint.Latitude,"M"); return (int)Convert.ToInt32(vd_Distance); }