/** * Get all the Stations in the collection. * * @return List of Station * @throws java.io.IOException I/O error */ public List getStations() throws IOException { return typical.getStations(); }
/** * Get all the Stations within a bounding box. * * @param boundingBox within this bounding box * @return List of Station * @throws java.io.IOException I/O error */ public List getStations(ucar.unidata.geoloc.LatLonRect boundingBox) throws IOException { return typical.getStations(boundingBox); }
/** * Get all the Stations within a bounding box. * * @param boundingBox within this bounding box * @return List of Station * @throws java.io.IOException I/O error */ public List getStations(ucar.unidata.geoloc.LatLonRect boundingBox) throws IOException { return typical.getStations(boundingBox); }
/** * Get all the Stations in the collection. * * @return List of Station * @throws java.io.IOException I/O error */ public List getStations() throws IOException { return typical.getStations(); }
/** * Get all the Stations in the collection. * * @return List of Station * @throws java.io.IOException I/O error */ public List getStations() throws IOException { return typical.getStations(); }
/** * Get all the Stations within a bounding box. * * @param boundingBox within this bounding box * @return List of Station * @throws java.io.IOException I/O error */ public List getStations(ucar.unidata.geoloc.LatLonRect boundingBox) throws IOException { return typical.getStations(boundingBox); }
public List getStationObs(LatLonRect boundingBox, CancelTask cancel) throws IOException { List stations = obsDataset.getStations( boundingBox, cancel); if (stations == null) return null; return getStationObs( stations, cancel); }
public List getStationObs(LatLonRect boundingBox, double startTime, double endTime, CancelTask cancel) throws IOException { List stations = obsDataset.getStations( boundingBox); if (stations == null) return null; return getStationObs( stations, startTime, endTime, cancel); }
public List getStationObs(LatLonRect boundingBox, CancelTask cancel) throws IOException { List stations = obsDataset.getStations( boundingBox, cancel); if (stations == null) return null; return getStationObs( stations, cancel); }
public List getStationObs(LatLonRect boundingBox, double startTime, double endTime, CancelTask cancel) throws IOException { List stations = obsDataset.getStations( boundingBox); if (stations == null) return null; return getStationObs( stations, startTime, endTime, cancel); }
public List getStationObs(LatLonRect boundingBox, CancelTask cancel) throws IOException { List stations = obsDataset.getStations( boundingBox, cancel); if (stations == null) return null; return getStationObs( stations, cancel); }
public List getStationObs(LatLonRect boundingBox, double startTime, double endTime, CancelTask cancel) throws IOException { List stations = obsDataset.getStations( boundingBox); if (stations == null) return null; return getStationObs( stations, startTime, endTime, cancel); }
public ucar.unidata.geoloc.Station getStation(String name) { if (stationHash == null) { List<ucar.unidata.geoloc.Station> stations; try { stations = obsDataset.getStations(); } catch (IOException e) { return null; } stationHash = new HashMap<String,ucar.unidata.geoloc.Station>( 2*stations.size()); for (ucar.unidata.geoloc.Station s : stations) { stationHash.put(s.getName(), s); } } return stationHash.get( name); }
public ucar.unidata.geoloc.Station getStation(String name) { if (stationHash == null) { List<ucar.unidata.geoloc.Station> stations; try { stations = obsDataset.getStations(); } catch (IOException e) { return null; } stationHash = new HashMap<String,ucar.unidata.geoloc.Station>( 2*stations.size()); for (ucar.unidata.geoloc.Station s : stations) { stationHash.put(s.getName(), s); } } return stationHash.get( name); }
public ucar.unidata.geoloc.Station getStation(String name) { if (stationHash == null) { List<ucar.unidata.geoloc.Station> stations; try { stations = obsDataset.getStations(); } catch (IOException e) { return null; } stationHash = new HashMap<String,ucar.unidata.geoloc.Station>( 2*stations.size()); for (ucar.unidata.geoloc.Station s : stations) { stationHash.put(s.getName(), s); } } return stationHash.get( name); }
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 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 static void main(String args[]) throws IOException { long start = System.currentTimeMillis(); String location = "C:/data/metars/Surface_METAR_20070513_0000.nc"; StringBuilder errlog = new StringBuilder(); StationObsDataset sobs = (StationObsDataset) TypedDatasetFactory.open(FeatureType.STATION, location, null, errlog); String fileOut = "C:/temp/Surface_METAR_20070513_0000.rewrite.nc"; WriterStationObsDataset writer = new WriterStationObsDataset(fileOut, "test"); List stns = sobs.getStations(); List<ucar.unidata.geoloc.Station> stnList = new ArrayList<ucar.unidata.geoloc.Station>(); ucar.unidata.geoloc.Station s = (ucar.unidata.geoloc.Station) stns.get(0); stnList.add(s); List<VariableSimpleIF> varList = new ArrayList<VariableSimpleIF>(); varList.add(sobs.getDataVariable("wind_speed")); writer.writeHeader(stnList, varList); DataIterator iter = sobs.getDataIterator(s); while (iter.hasNext()) { StationObsDatatype sobsData = (StationObsDatatype) iter.nextData(); StructureData data = sobsData.getData(); writer.writeRecord(sobsData, data); } writer.finish(); long took = System.currentTimeMillis() - start; System.out.println("That took = " + took); }
/** * Create an XML document from this info */ public Document makeStationCollectionDocument() throws IOException { Element rootElem = new Element("stationCollection"); Document doc = new Document(rootElem); List stns = sobs.getStations(); System.out.println("nstns = "+stns.size()); for (int i = 0; i < stns.size(); i++) { ucar.unidata.geoloc.Station s = (ucar.unidata.geoloc.Station) stns.get(i); Element sElem = new Element("station"); sElem.setAttribute("name",s.getName()); if (s.getWmoId() != null) sElem.setAttribute("wmo_id",s.getWmoId()); if (s.getDescription() != null) sElem.addContent(new Element("description").addContent(s.getDescription())); sElem.addContent(new Element("longitude").addContent( ucar.unidata.util.Format.d(s.getLongitude(), 6))); sElem.addContent(new Element("latitide").addContent( ucar.unidata.util.Format.d(s.getLatitude(), 6))); if (!Double.isNaN(s.getAltitude())) sElem.addContent(new Element("altitude").addContent( ucar.unidata.util.Format.d(s.getAltitude(), 6))); rootElem.addContent(sElem); } return doc; }