本文整理匯總了Java中com.axiomalaska.phenomena.Phenomenon類的典型用法代碼示例。如果您正苦於以下問題:Java Phenomenon類的具體用法?Java Phenomenon怎麽用?Java Phenomenon使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Phenomenon類屬於com.axiomalaska.phenomena包,在下文中一共展示了Phenomenon類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testTooManyFeatureTypesRequest
import com.axiomalaska.phenomena.Phenomenon; //導入依賴的package包/類
@Test(expected=UnsupportedEncoderInputException.class)
public void testTooManyFeatureTypesRequest() throws FileNotFoundException, OwsExceptionReport,
IOException, UnitCreationException {
Phenomenon airTemp = Phenomena.instance().AIR_TEMPERATURE;
Phenomenon waterTemp = Phenomena.instance().SEA_WATER_TEMPERATURE;
makeNetcdfRequest(Lists.newArrayList(makeSensor("1", airTemp), makeSensor("1", waterTemp)),
Lists.newArrayList(airTemp, waterTemp), false);
}
示例2: testTooManySensorsRequest
import com.axiomalaska.phenomena.Phenomenon; //導入依賴的package包/類
@Test(expected=UnsupportedEncoderInputException.class)
public void testTooManySensorsRequest() throws FileNotFoundException, OwsExceptionReport,
IOException, UnitCreationException {
Phenomenon airTemp = Phenomena.instance().AIR_TEMPERATURE;
makeNetcdfRequest(Lists.newArrayList(makeSensor("1", airTemp), makeSensor("2", airTemp)),
Lists.newArrayList(airTemp), false);
}
示例3: getSensors
import com.axiomalaska.phenomena.Phenomenon; //導入依賴的package包/類
private List<SosSensor> getSensors(SosStation station) throws UnitCreationException {
SosNetwork airTemperatureNetwork = getAirTemperatureNetwork("cnfaic");
List<SosSensor> sensors = new ArrayList<SosSensor>();
List<Phenomenon> phenomena = new ArrayList<Phenomenon>();
Phenomenon airTemperature = Phenomena.instance().AIR_TEMPERATURE;
phenomena.add(airTemperature);
SosSensor airTemperatureSensor = new SosSensor();
airTemperatureSensor.setStation(station);
airTemperatureSensor.setAsset(new SensorAsset(station.getAsset(), findPhenomenonTag(airTemperature)));
airTemperatureSensor.setPhenomena(phenomena);
airTemperatureSensor.setShortName(airTemperature.getName());
airTemperatureSensor.addNetwork(airTemperatureNetwork);
sensors.add(airTemperatureSensor);
phenomena = new ArrayList<Phenomenon>();
Phenomenon relativeHumidity = Phenomena.instance().RELATIVE_HUMIDITY;
phenomena.add(relativeHumidity);
SosSensor relativeHumiditySensor = new SosSensor();
relativeHumiditySensor.setStation(station);
relativeHumiditySensor.setAsset(new SensorAsset(station.getAsset(), findPhenomenonTag(relativeHumidity)));
relativeHumiditySensor.setPhenomena(phenomena);
relativeHumiditySensor.setShortName(relativeHumidity.getName());
sensors.add(relativeHumiditySensor);
phenomena = new ArrayList<Phenomenon>();
phenomena.add(Phenomena.instance().WIND_SPEED);
phenomena.add(Phenomena.instance().WIND_FROM_DIRECTION);
phenomena.add(Phenomena.instance().WIND_SPEED_OF_GUST);
SosSensor windSensor = new SosSensor();
windSensor.setStation(station);
windSensor.setAsset(new SensorAsset(station.getAsset(), "wind"));
windSensor.setPhenomena(phenomena);
windSensor.setShortName("Wind");
sensors.add(windSensor);
return sensors;
}
示例4: createSensor
import com.axiomalaska.phenomena.Phenomenon; //導入依賴的package包/類
private static void createSensor(int i, CF.FeatureType featureType, Offering hNetworkOffering, Procedure networkProcedure,
Offering hStationOffering, Procedure stationProcedure, StationAsset station, SamplingFeature samplingFeature,
FeatureOfInterest hStationFeature, Point stationPoint, Phenomenon phen,
OmObservableProperty omObsProp, ObservableProperty obsProp, String unit, ObservationType obsType, ProcedureDescriptionFormat pdf,
Map<String,Codespace> codespaceCache, Map<String,Unit> unitCache, Session session) throws OwsExceptionReport {
String phenShortName = getPhenomenonShortId(phen.getId());
final SimpleIo airTempSimpleIo = new SimpleIo(phenShortName, phen.getId(), unit);
final SensorAsset sensor = new SensorAsset(TEST, Integer.toString(i), phenShortName);
final String sensorSml = IoosTestDataSmlGenerator.createSensorSensorMl(sensor.getAssetId(),
"Test station " + i + " " + phen.getName() + " sensor",
"Test station " + i + " " + phen.getName() + " sensor",
"Station number " + i + " " + phen.getName() + " sensor",
CollectionHelper.list(airTempSimpleIo));
//TODO switch to manually build System instead of making xml
//TODO decode xml
Object decodedXml = CodingHelper.decodeXmlObject(sensorSml);
org.n52.sos.ogc.sensorML.System sensorSystem = new org.n52.sos.ogc.sensorML.System();
sensorSystem.setIdentifier(sensor.getAssetId());
sensorSystem.setParentProcedures(CollectionHelper.list(station.getAssetId()));
final Procedure sensorProcedure = insertProcedure(sensorSystem, pdf, sensorSml, session);
Set<ObservationConstellation> obsConsts = new HashSet<ObservationConstellation>();
Set<ObservationConstellation> sensorObsConsts = new HashSet<ObservationConstellation>();
// when offering and procedure are same hiddenChild is false, otherwise true
ObservationConstellation sensorForNetworkOffering = obsConstDAO.checkOrInsertObservationConstellation(
sensorProcedure, obsProp, hNetworkOffering, true, session);
obsConsts.add(sensorForNetworkOffering);
sensorObsConsts.add(sensorForNetworkOffering);
obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(stationProcedure,
obsProp, hNetworkOffering, true, session));
obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(networkProcedure,
obsProp, hNetworkOffering, false, session));
ObservationConstellation sensorForStationOffering = obsConstDAO.checkOrInsertObservationConstellation(
sensorProcedure, obsProp, hStationOffering, true, session);
obsConsts.add(sensorForStationOffering);
sensorObsConsts.add(sensorForStationOffering);
obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(stationProcedure,
obsProp, hStationOffering, false, session));
//set measurement types on sesnor obs consts
for (ObservationConstellation obsConst : sensorObsConsts) {
obsConst.setObservationType(obsType);
session.save(obsConst);
}
//create OmObservationConstellation for OmObservations
OmObservationConstellation omObsConst = new OmObservationConstellation();
omObsConst.setProcedure(sensorSystem);
omObsConst.setObservableProperty(omObsProp);
omObsConst.setFeatureOfInterest(samplingFeature);
//add values
DateTime obsEndTime = new DateTime(DateTimeZone.UTC).withMillisOfSecond(0).withSecondOfMinute(0).withMinuteOfHour(0);
if (featureType.equals(CF.FeatureType.timeSeriesProfile)) {
for (int h = 0; h < NUM_HEIGHTS_PER_PROFILE; h++) {
Geometry foiGeom = GeomHelper.createLatLngPoint(stationPoint.getY(), stationPoint.getX(), 0 - 5.0 * h);
String foiId;
try {
foiId = IoosSosUtil.createObservationFeatureOfInterestId(station, stationPoint, sensor, stationPoint, foiGeom);
} catch (UnsupportedGeometryTypeException e) {
throw new NoApplicableCodeException().causedBy(e);
}
SamplingFeature profileFeature = new SamplingFeature(new CodeWithAuthority(foiId));
profileFeature.setGeometry(foiGeom);
FeatureOfInterest hProfileFeature = featureOfInterestDAO.checkOrInsertFeatureOfInterest(profileFeature, session);
insertObservation(sensorObsConsts, omObsConst, obsEndTime, hProfileFeature, unit, codespaceCache, unitCache, session);
}
} else {
//normal time series
insertObservation(sensorObsConsts, omObsConst, obsEndTime, hStationFeature, unit, codespaceCache, unitCache, session);
}
}
示例5: makeNetcdfRequest
import com.axiomalaska.phenomena.Phenomenon; //導入依賴的package包/類
private List<File> makeNetcdfRequest(Phenomenon phenomenon) throws OwsExceptionReport,
FileNotFoundException, IOException {
return makeNetcdfRequest(phenomenon, false);
}
示例6: makeSensor
import com.axiomalaska.phenomena.Phenomenon; //導入依賴的package包/類
public SensorAsset makeSensor(String id, Phenomenon phenomenon) {
return new SensorAsset(IoosHibernateTestDataManager.TEST, id,
IoosSosUtil.getNameFromUri(phenomenon.getId()));
}
示例7: findPhenomenonTag
import com.axiomalaska.phenomena.Phenomenon; //導入依賴的package包/類
private String findPhenomenonTag(Phenomenon phenomenon) {
int index = phenomenon.getId().lastIndexOf("/") + 1;
return phenomenon.getId().substring(index);
}