本文整理汇总了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);
}