public StationFeatureImpl( StationFeature from) throws IOException { super(from, 0); this.sdata = from.getFeatureData(); }
public StationFeatureImpl( StationFeature from) throws IOException { super(from, 0); this.sdata = from.getFeatureData(); }
@Override public StructureData getFeatureData() throws IOException { return s.getFeatureData(); }
@Nonnull @Override public StructureData getFeatureData() throws IOException { return ((StationFeature) station).getFeatureData(); }
@Override public StationTimeSeriesFeature getStationFeature(Station s) throws IOException { StationFeature stnFeature = getStationHelper().getStationFeature(s); return new CompositeStationFeature(stnFeature, timeUnit, altUnits, stnFeature.getFeatureData(), dataCollection); }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); for (StationFeature stationFeat : this.stationFeats) { stationHelper.addStation(new CompositeStationFeature( stationFeat, timeUnit, altUnits, stationFeat.getFeatureData(), from.dataCollection)); } return stationHelper; } }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); for (StationFeature stationFeat : this.stationFeats) { stationHelper.addStation(new CompositeStationFeature( stationFeat, timeUnit, altUnits, stationFeat.getFeatureData(), from.dataCollection)); } return stationHelper; } }
public static boolean equals(StationFeature stationFeat1, StationFeature stationFeat2) throws IOException { if (stationFeat1 == stationFeat2) { return true; } else if (stationFeat1 == null || stationFeat2 == null) { return false; } if (!equals((Station) stationFeat1, stationFeat2)) { return false; } else if (!equals(stationFeat1.getFeatureData(), stationFeat2.getFeatureData())) { return false; } return true; }
StructureData stnData = sf.getFeatureData(); StructureData obsData = spf.getFeatureData();
StructureData stnData = sf.getFeatureData(); StructureData obsData = spf.getFeatureData();
@Override protected StationHelper createStationHelper() throws IOException { TimedCollection.Dataset td = dataCollection.getPrototype(); if (td == null) throw new RuntimeException("No datasets in the collection"); Formatter errlog = new Formatter(); try (FeatureDatasetPoint openDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.STATION, td.getLocation(), null, errlog)) { if (openDataset == null) throw new IllegalStateException("Cant open FeatureDatasetPoint " + td.getLocation()); StationHelper stationHelper = new StationHelper(); List<DsgFeatureCollection> fcList = openDataset.getPointFeatureCollectionList(); StationTimeSeriesCollectionImpl openCollection = (StationTimeSeriesCollectionImpl) fcList.get(0); List<StationFeature> stns = openCollection.getStationFeatures(); for (StationFeature stnFeature : stns) { stationHelper.addStation(new CompositeStationFeature(stnFeature, timeUnit, altUnits, stnFeature.getFeatureData(), this.dataCollection)); } dataVariables = openDataset.getDataVariables(); globalAttributes = openDataset.getGlobalAttributes(); return stationHelper; } }
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); }
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()); 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, featureVarMap); }
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); }
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); }
List<StationFeature> stations = sc.getStationFeatures(); for (StationFeature s : stations) { StructureData sdata = s.getFeatureData(); StructureMembers.Member m = sdata.findMember("stnInfo"); assert m != null : "missing stnInfo";
StructureData stnData = stnFeat.getFeatureData(); Assert.assertNotEquals(sdata, stnData);