예제 #1
0
파일: Module.cs 프로젝트: mtswiss/UniWork
 /*
  * 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;
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }