当前位置: 首页>>代码示例>>Java>>正文


Java Phenomenon类代码示例

本文整理汇总了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);
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:9,代码来源:IoosNetcdfEncoderTest.java

示例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);
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:8,代码来源:IoosNetcdfEncoderTest.java

示例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;
}
 
开发者ID:ioos,项目名称:sos-injector-example,代码行数:40,代码来源:CnfaicStationRetriever.java

示例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);
    }
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:78,代码来源:IoosHibernateTestDataManager.java

示例5: makeNetcdfRequest

import com.axiomalaska.phenomena.Phenomenon; //导入依赖的package包/类
private List<File> makeNetcdfRequest(Phenomenon phenomenon) throws OwsExceptionReport,
    FileNotFoundException, IOException {
    return makeNetcdfRequest(phenomenon, false);
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:5,代码来源:AbstractIoosNetcdfEncoderTest.java

示例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()));
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:5,代码来源:AbstractIoosNetcdfEncoderTest.java

示例7: findPhenomenonTag

import com.axiomalaska.phenomena.Phenomenon; //导入依赖的package包/类
private String findPhenomenonTag(Phenomenon phenomenon) {
	int index = phenomenon.getId().lastIndexOf("/") + 1;
	return phenomenon.getId().substring(index);
}
 
开发者ID:ioos,项目名称:sos-injector-example,代码行数:5,代码来源:CnfaicStationRetriever.java


注:本文中的com.axiomalaska.phenomena.Phenomenon类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。