Esempio n. 1
0
 public static void addDropSite(dropSitePolygonData d)
 {
     for (int i = dropSites.Count - 1; i >= 0; i--)
     {
         if (dropSites[i].ID == d.ID)
         {
             dropSites.RemoveAt(i);
         }
     }
     dropSites.Add(d);
 }
Esempio n. 2
0
        public static void addDropSite(dropSitePolygonData d)
        {
            for (int i = dropSites.Count - 1; i >= 0; i--)
            {
                if (dropSites[i].ID == d.ID)
                {
                    dropSites.RemoveAt(i);
                }
            }

            d.maxLat = d.geoFence[0].lat;
            d.maxLon = d.geoFence[0].lon;
            d.minLat = d.geoFence[0].lat;
            d.minLon = d.geoFence[0].lon;
            foreach (latLon ll in d.geoFence)
            {
                if (ll.lat < d.minLat)
                {
                    d.minLat = ll.lat;
                }
                if (ll.lat > d.maxLat)
                {
                    d.maxLat = ll.lat;
                }
                if (ll.lon < d.minLon)
                {
                    d.minLon = ll.lon;
                }
                if (ll.lon > d.maxLon)
                {
                    d.maxLon = ll.lon;
                }
            }


            SQL.SQLCode sql = new SQL.SQLCode();
            sql.updateDropSitePolygon(d);
            dropSites.Add(d);
        }