}
public BoundingBox(List<? extends NavigationPosition> positions) {
double maximumLongitude = -180.0, maximumLatitude = -90.0,
minimumLongitude = 180.0, minimumLatitude = 90.0;
CompactCalendar maximumTime = null, minimumTime = null;
for (NavigationPosition position : positions) {
Double longitude = position.getLongitude();
if (longitude == null)
continue;
if (longitude > maximumLongitude)
maximumLongitude = longitude;
if (longitude < minimumLongitude)
minimumLongitude = longitude;
Double latitude = position.getLatitude();
if (latitude == null)
continue;
if (latitude > maximumLatitude)
maximumLatitude = latitude;
if (latitude < minimumLatitude)
minimumLatitude = latitude;
CompactCalendar time = position.getTime();
if (time == null)
continue;
if (maximumTime == null || time.after(maximumTime))
maximumTime = time;
if (minimumTime == null || time.before(minimumTime))
minimumTime = time;
}
this.northEast = new SimpleNavigationPosition(maximumLongitude, maximumLatitude, maximumTime);
this.southWest = new SimpleNavigationPosition(minimumLongitude, minimumLatitude, minimumTime);
}