/* * get the GPS coordinate of a point */ public static Hashtable getCoordinates(IKmlPlacemark point) { Hashtable cods = new Hashtable(); String xml = point.getKml(); String temp = System.Text.RegularExpressions.Regex.Split(xml, "<coordinates>")[1]; String coords = System.Text.RegularExpressions.Regex.Split(temp, "</coordinates>")[0]; Array value = System.Text.RegularExpressions.Regex.Split(coords, ","); cods["lon"] = double.Parse((String)value.GetValue(0)); cods["lat"] = double.Parse((String)value.GetValue(1)); return cods; }
private Hashtable getCoordinates(IKmlPlacemark point) { Hashtable cods = new Hashtable(); String xml = point.getKml(); String temp = System.Text.RegularExpressions.Regex.Split(xml, "<coordinates>")[1]; String coords = System.Text.RegularExpressions.Regex.Split(temp, "</coordinates>")[0]; Array value = System.Text.RegularExpressions.Regex.Split(coords, ","); cods["lon"] = value.GetValue(1); cods["lat"] = value.GetValue(0); return(cods); }
public Hashtable getCoordinates(String name) { Hashtable cods = new Hashtable(); IKmlPlacemark point = getByName(name); String xml = point.getKml(); String temp = System.Text.RegularExpressions.Regex.Split(xml, "<coordinates>")[1]; String coords = System.Text.RegularExpressions.Regex.Split(temp, "</coordinates>")[0]; Array value = System.Text.RegularExpressions.Regex.Split(coords, ","); cods["lat"] = float.Parse((String)value.GetValue(1)); cods["lon"] = float.Parse((String)value.GetValue(0)); return(cods); }