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


Java GeomHelper.createLatLngPoint方法代码示例

本文整理汇总了Java中com.axiomalaska.ioos.sos.GeomHelper.createLatLngPoint方法的典型用法代码示例。如果您正苦于以下问题:Java GeomHelper.createLatLngPoint方法的具体用法?Java GeomHelper.createLatLngPoint怎么用?Java GeomHelper.createLatLngPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.axiomalaska.ioos.sos.GeomHelper的用法示例。


在下文中一共展示了GeomHelper.createLatLngPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSamplingFeature

import com.axiomalaska.ioos.sos.GeomHelper; //导入方法依赖的package包/类
protected SamplingFeature createSamplingFeature(String featureIdentifier, double lat, double lng, double height)
        throws InvalidSridException {
    SamplingFeature samplingFeature = new SamplingFeature(new CodeWithAuthority(featureIdentifier));
    Point point = GeomHelper.createLatLngPoint(lat, lng, height);
    samplingFeature.setGeometry(point);
    return samplingFeature;
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:8,代码来源:AbstractIoosComplianceSuiteTest.java

示例2: createSensor

import com.axiomalaska.ioos.sos.GeomHelper; //导入方法依赖的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


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