/** * Determine if this bounding box is contained in another LatLonRect. * * @param b the other box to see if it contains this one * @return true if b contained in this bounding box */ public boolean containedIn(LatLonRect b) { return (b.getWidth() >= width) && b.contains(upperRight) && b.contains(lowerLeft); }
/** * Determine if this bounding box is contained in another LatLonRect. * * @param b the other box to see if it contains this one * @return true if b contained in this bounding box */ public boolean containedIn(LatLonRect b) { return (b.getWidth() >= width) && b.contains(upperRight) && b.contains(lowerLeft); }
public boolean filter(PointFeatureCollection pointFeatureCollection) { ProfileFeature profileFeature = (ProfileFeature) pointFeatureCollection; return boundingBox.contains(profileFeature.getLatLon()); } }
public boolean filter(PointFeatureCollection pointFeatureCollection) { ProfileFeature profileFeature = (ProfileFeature) pointFeatureCollection; return boundingBox.contains(profileFeature.getLatLon()); } }
public boolean filter(PointFeatureCollection pointFeatureCollection) { ProfileFeature profileFeature = (ProfileFeature) pointFeatureCollection; return boundingBox.contains(profileFeature.getLatLon()); } }
public boolean filter(PointFeatureCollection pointFeatureCollection) { ProfileFeature profileFeature = (ProfileFeature) pointFeatureCollection; return boundingBox.contains(profileFeature.getLatLon()); } }
@Override @Nullable public PointFeatureCollection subset(LatLonRect boundingBox, CalendarDateRange dateRange) throws IOException { if (boundingBox != null) { if (!boundingBox.contains(s.getLatLon())) return null; if (dateRange == null) return this; } return subset(dateRange); }
@Override public PointFeatureCollection subset(LatLonRect boundingBox, CalendarDateRange dateRange) throws IOException { if (boundingBox != null) { if (!boundingBox.contains(s.getLatLon())) return null; if (dateRange == null) return this; } return subset(dateRange); }
/** * Determine if a specified LatLonPoint is contained in this bounding box. * * @param p the specified point to be tested * @return true if point is contained in this bounding box */ public boolean contains(LatLonPoint p) { return contains(p.getLatitude(), p.getLongitude()); }
@Override public PointFeatureCollection subset(LatLonRect boundingBox, CalendarDateRange dateRange) throws IOException { if (boundingBox != null) { if (!boundingBox.contains(s.getLatLon())) return null; if (dateRange == null) return this; } return subset(dateRange); }
public List<StationFeature> getStationFeatures(LatLonRect boundingBox) throws IOException { if (boundingBox == null) return stations; LatLonPointImpl latlonPt = new LatLonPointImpl(); List<StationFeature> result = new ArrayList<>(); for (StationFeature s : stations) { latlonPt.set(s.getLatitude(), s.getLongitude()); if (boundingBox.contains(latlonPt)) result.add(s); } return result; }
public List<StationFeature> getStationFeatures(LatLonRect boundingBox) throws IOException { if (boundingBox == null) return stations; LatLonPointImpl latlonPt = new LatLonPointImpl(); List<StationFeature> result = new ArrayList<>(); for (StationFeature s : stations) { latlonPt.set(s.getLatitude(), s.getLongitude()); if (boundingBox.contains(latlonPt)) result.add(s); } return result; }
public List<Station> getStations(LatLonRect boundingBox) throws IOException { if (boundingBox == null) return stations; LatLonPointImpl latlonPt = new LatLonPointImpl(); List<Station> result = new ArrayList<Station>(); for (Station s : stations) { latlonPt.set(s.getLatitude(), s.getLongitude()); if (boundingBox.contains(latlonPt)) result.add(s); } return result; }
public List<ucar.unidata.geoloc.Station> getStations(LatLonRect boundingBox, CancelTask cancel) throws IOException { LatLonPointImpl latlonPt = new LatLonPointImpl(); List<ucar.unidata.geoloc.Station> result = new ArrayList<ucar.unidata.geoloc.Station>(); List<ucar.unidata.geoloc.Station> stations = obsDataset.getStations(); for (ucar.unidata.geoloc.Station s : stations) { latlonPt.set(s.getLatitude(), s.getLongitude()); if (boundingBox.contains(latlonPt)) result.add(s); if ((cancel != null) && cancel.isCancel()) return null; } return result; }
public List<ucar.unidata.geoloc.Station> getStations(LatLonRect boundingBox, CancelTask cancel) throws IOException { LatLonPointImpl latlonPt = new LatLonPointImpl(); List<ucar.unidata.geoloc.Station> result = new ArrayList<ucar.unidata.geoloc.Station>(); List<ucar.unidata.geoloc.Station> stations = obsDataset.getStations(); for (ucar.unidata.geoloc.Station s : stations) { latlonPt.set(s.getLatitude(), s.getLongitude()); if (boundingBox.contains(latlonPt)) result.add(s); if ((cancel != null) && cancel.isCancel()) return null; } return result; }
public void testGlobalBB() { Random rand = new Random(System.currentTimeMillis()); int count = 0; while(count++ <1000) { double r = 360.*rand.nextFloat()-180; LatLonRect llbb = new LatLonRect(new LatLonPointImpl(20.0, r), 20.0, 360.0); double r2 = 360.*rand.nextFloat()-180; LatLonPointImpl p = new LatLonPointImpl(30.0, r2); assert llbb.contains(p); } }
private boolean filter(PointFeature pdata) { if ((filter_date != null) && !filter_date.includes(pdata.getObservationTimeAsCalendarDate())) return false; if ((filter_bb != null) && !filter_bb.contains(pdata.getLocation().getLatitude(), pdata.getLocation().getLongitude())) return false; return true; }
public boolean filter(PointFeature pdata) { if ((filter_date != null) && !filter_date.includes(pdata.getObservationTimeAsCalendarDate())) return false; if ((filter_bb != null) && !filter_bb.contains(pdata.getLocation().getLatitude(), pdata.getLocation().getLongitude())) return false; return true; }
private boolean filter(PointFeature pdata) { if ((filter_date != null) && !filter_date.includes(pdata.getObservationTimeAsCalendarDate())) return false; if ((filter_bb != null) && !filter_bb.contains(pdata.getLocation().getLatitude(), pdata.getLocation().getLongitude())) return false; return true; }
public boolean filter(PointFeature pdata) { if ((filter_date != null) && !filter_date.includes(pdata.getObservationTimeAsCalendarDate())) return false; if ((filter_bb != null) && !filter_bb.contains(pdata.getLocation().getLatitude(), pdata.getLocation().getLongitude())) return false; return true; }