public StationFeatureImpl( StationFeature from) throws IOException { super(from, 0); this.sdata = from.getFeatureData(); }
public void addStation( StationFeature s) { stations.add(s); stationHash.put(s.getName(), s); }
public void setStations(List<StationFeature> stns) throws IOException { this.stnList = stns; // see if there's altitude, wmoId for any stations for (StationFeature stn : stnList) { if (!Double.isNaN(stn.getAltitude())) useAlt = true; if ((stn.getWmoId() != null) && (stn.getWmoId().trim().length() > 0)) useWmoId = true; if ((stn.getDescription() != null) && (stn.getDescription().trim().length() > 0)) useDesc = true; // find string lengths id_strlen = Math.max(id_strlen, stn.getName().length()); if (stn.getDescription() != null) desc_strlen = Math.max(desc_strlen, stn.getDescription().length()); if (stn.getWmoId() != null) wmo_strlen = Math.max(wmo_strlen, stn.getWmoId().length()); } llbb = CFPointWriterUtils.getBoundingBox(stnList); // gets written in super.finish(); }
private void writeStationData(StationFeature stn) throws IOException { StructureDataScalar stnCoords = new StructureDataScalar("Coords"); stnCoords.addMember(latName, null, null, DataType.DOUBLE, stn.getLatLon().getLatitude()); stnCoords.addMember(lonName, null, null, DataType.DOUBLE, stn.getLatLon().getLongitude()); if (useAlt) stnCoords.addMember(stationAltName, null, null, DataType.DOUBLE, stn.getAltitude()); stnCoords.addMemberString(stationIdName, null, null, stn.getName().trim(), id_strlen); if (useDesc) stnCoords.addMemberString(descName, null, null, stn.getDescription().trim(), desc_strlen); if (useWmoId) stnCoords.addMemberString(wmoName, null, null, stn.getWmoId().trim(), wmo_strlen); StructureDataComposite sdall = new StructureDataComposite(); sdall.add(stnCoords); // coords first so it takes precedence sdall.add(stn.getFeatureData()); stnRecno = super.writeStructureData(stnRecno, stationStruct, sdall, stationVarMap); }
StructureData stnData = sf.getFeatureData(); StructureData obsData = spf.getFeatureData(); for (StationFeature stn : stnList) { writeStationData(stn); stationIndexMap.put(stn.getName(), count); count++;
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; }
@Override public LatLonPoint getLatLon() { return s.getLatLon(); }
@Override public double getLongitude() { return s.getLongitude(); }
@Override public String getWmoId() { return s.getWmoId(); }
@Override public String getDescription() { return s.getDescription(); }
@Override public double getLatitude() { return s.getLatitude(); }
@Override public double getAltitude() { return s.getAltitude(); }
private void writeStationData(StationFeature stn) throws IOException { StructureDataScalar stnCoords = new StructureDataScalar("Coords"); stnCoords.addMember(latName, null, null, DataType.DOUBLE, false, stn.getLatLon().getLatitude()); stnCoords.addMember(lonName, null, null, DataType.DOUBLE, false, stn.getLatLon().getLongitude()); stnCoords.addMember(stationAltName, null, null, DataType.DOUBLE, false, stn.getAltitude()); stnCoords.addMemberString(stationIdName, null, null, stn.getName().trim(), id_strlen); if (useDesc) stnCoords.addMemberString(descName, null, null, stn.getDescription().trim(), desc_strlen); if (useWmoId) stnCoords.addMemberString(wmoName, null, null, stn.getWmoId().trim(), wmo_strlen); StructureDataComposite sdall = new StructureDataComposite(); sdall.add(stnCoords); // coords first so it takes precedence sdall.add(stn.getFeatureData()); stnRecno = super.writeStructureData(stnRecno, stationStruct, sdall, featureVarMap); }
StructureData stnData = sf.getFeatureData(); StructureData obsData = spf.getFeatureData(); for (StationFeature stn : stnList) { writeStationData(stn); stationIndexMap.put(stn.getName(), count); count++;
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; }
@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); }
private void writeStationData(StationFeature stn) throws IOException { StructureDataScalar stnCoords = new StructureDataScalar("Coords"); stnCoords.addMember(latName, null, null, DataType.DOUBLE, false, stn.getLatLon().getLatitude()); stnCoords.addMember(lonName, null, null, DataType.DOUBLE, false, stn.getLatLon().getLongitude()); if (useAlt) stnCoords.addMember(stationAltName, null, null, DataType.DOUBLE, false, stn.getAltitude()); stnCoords.addMemberString(stationIdName, null, null, stn.getName().trim(), id_strlen); if (useDesc) stnCoords.addMemberString(descName, null, null, stn.getDescription().trim(), desc_strlen); if (useWmoId) stnCoords.addMemberString(wmoName, null, null, stn.getWmoId().trim(), wmo_strlen); StructureDataComposite sdall = new StructureDataComposite(); sdall.add(stnCoords); // coords first so it takes precedence sdall.add(stn.getFeatureData()); stnRecno = super.writeStructureData(stnRecno, stationStruct, sdall, stationVarMap); }
public void addStation( StationFeature s) { stations.add(s); stationHash.put(s.getName(), s); }
public void setStations(List<StationFeature> stns) throws IOException { this.stnList = stns; // see if there's altitude, wmoId for any stations for (StationFeature stn : stnList) { if (!Double.isNaN(stn.getAltitude())) useAlt = true; if ((stn.getWmoId() != null) && (stn.getWmoId().trim().length() > 0)) useWmoId = true; if ((stn.getDescription() != null) && (stn.getDescription().trim().length() > 0)) useDesc = true; // find string lengths id_strlen = Math.max(id_strlen, stn.getName().length()); if (stn.getDescription() != null) desc_strlen = Math.max(desc_strlen, stn.getDescription().length()); if (stn.getWmoId() != null) wmo_strlen = Math.max(wmo_strlen, stn.getWmoId().length()); } llbb = CFPointWriterUtils.getBoundingBox(stnList); // gets written in super.finish(); }
public StationFeatureImpl( StationFeature from) throws IOException { super(from, 0); this.sdata = from.getFeatureData(); }