public static void addBeatSegment(beatSegmentPolygonData b) { for (int i = bsPolyList.Count - 1; i >= 0; i--) { if (bsPolyList[i].ID == b.ID) { bsPolyList.RemoveAt(i); } bsPolyList.Add(b); } }
public static void addBeatSegment(beatSegmentPolygonData b) { for (int i = bsPolyList.Count - 1; i >= 0; i--) { if (bsPolyList[i].ID == b.ID) { bsPolyList.RemoveAt(i); } } //if (b.maxLat == 0 || b.maxLon == 0 || b.minLat == 0 || b.minLon == 0) //{ b.maxLat = b.geoFence[0].lat; b.maxLon = b.geoFence[0].lon; b.minLat = b.geoFence[0].lat; b.minLon = b.geoFence[0].lon; foreach (latLon ll in b.geoFence) { if (ll.lat < b.minLat) { b.minLat = ll.lat; } if (ll.lat > b.maxLat) { b.maxLat = ll.lat; } if (ll.lon < b.minLon) { b.minLon = ll.lon; } if (ll.lon > b.maxLon) { b.maxLon = ll.lon; } } // } SQL.SQLCode sql = new SQL.SQLCode(); sql.updateBeatSegmentPolygon(b); bsPolyList.Add(b); }