org.n52.sos.ogc.om.values.Value类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(10.8k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中org.n52.sos.ogc.om.values.Value类的一些代码示例,展示了Value类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value类的具体详情如下:
包路径:org.n52.sos.ogc.om.values.Value
类名称:Value

Value介绍

暂无

代码示例

代码示例来源:origin: org.n52.sensorweb.sos/coding-wml-v20

/**
 * Get a value list from SOS TimeValuePair objects
 * 
 * @param timeValuePairs
 *            SOS TimeValuePair objects
 * @return List with value objects
 * @throws OwsExceptionReport
 *             If an error occurs
 */
private List<Object> getValueList(List<TimeValuePair> timeValuePairs) throws OwsExceptionReport {
  ArrayList<Object> values = new ArrayList<Object>(timeValuePairs.size());
  for (TimeValuePair timeValuePair : timeValuePairs) {
    if (timeValuePair.getValue() != null
        && (timeValuePair.getValue() instanceof CountValue || timeValuePair.getValue() instanceof QuantityValue)) {
      values.add(timeValuePair.getValue().getValue());
    }
  }
  return values;
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-uvf

private String getUnit(OmObservation o) {
  if (o.getObservationConstellation().getObservableProperty() instanceof OmObservableProperty
      && ((OmObservableProperty)o.getObservationConstellation().getObservableProperty()).isSetUnit()) {
    return ((OmObservableProperty)o.getObservationConstellation().getObservableProperty()).getUnit();
  } else if (o.getValue().isSetValue() && o.getValue().getValue().isSetUnit()) {
      return o.getValue().getValue().getUnit();
  }
  return null;
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-uvf

private String encodeObservationValue(Value<?> value) throws CodedException {
  if (value == null || (value != null && !value.isSetValue())) {
    return UVFConstants.NO_DATA_STRING;
  }
  if (!(value instanceof SweQuantity) && !(value instanceof SweCount)) {
    String errorMessage = String.format("SweType '%s' not supported. Only '%s' and '%s'.",
        value.getClass().getName(),
        SweQuantity.class.getName(),
        SweCount.class.getName());
    LOGGER.error(errorMessage);
    throw new NoApplicableCodeException().withMessage(errorMessage);
  }
  String encodedValue = JavaHelper.asString(value.getValue());
  if (encodedValue.length()> UVFConstants.MAX_VALUE_LENGTH) {
    encodedValue = encodedValue.substring(0, UVFConstants.MAX_VALUE_LENGTH);
  }
  return encodedValue;
}

代码示例来源:origin: org.n52.sensorweb.sos/inspire-api

ProfileValue profile = (ProfileValue) value.getValue();
RectifiedGridCoverage rectifiedGridCoverage = new RectifiedGridCoverage(getObservationID());
rectifiedGridCoverage.setUnit(value.getValue().getUnit());
rectifiedGridCoverage.setRangeParameters(getObservationConstellation().getObservablePropertyIdentifier());
List<Coordinate> coordinates = Lists.newArrayList();
double heightDepth = 0;
if (isSetHeightDepthParameter()) {
  heightDepth = getHeightDepthParameter().getValue().getValue();
  removeParameter(getHeightDepthParameter());
rectifiedGridCoverage.setUnit(value.getValue().getUnit());
rectifiedGridCoverage.addValue(heightDepth, value.getValue());
super.setValue(new SingleObservationValue<>(value.getPhenomenonTime(), rectifiedGridCoverage));

代码示例来源:origin: org.n52.sensorweb.sos/inspire-api

/**
   * Convert {@link SingleObservationValue} to {@link TVPValue}
   * 
   * @param singleValue
   *            Single observation value
   * @return Converted TVPValue value
   */
  private TLVTValue convertSingleValueToMultiValue(final SingleObservationValue<?> singleValue, Geometry geom) {
    final TLVTValue tlvpValue = new TLVTValue();
    tlvpValue.setUnit(singleValue.getValue().getUnit());
    final TimeLocationValueTriple timeLocationValueTriple =
        new TimeLocationValueTriple(singleValue.getPhenomenonTime(), singleValue.getValue(), geom);
    tlvpValue.addValue(timeLocationValueTriple);
    return tlvpValue;
  }
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-uvf

private boolean checkForSingleObservationValue(ObservationValue<?> value) {
  return value instanceof SingleObservationValue<?> && value.getValue().isSetValue()
      && (value.getValue() instanceof CountValue || value.getValue() instanceof QuantityValue);
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-json

private JsonNode encodeValue(Value<?> value)
    throws OwsExceptionReport {
  return value.accept(new ValueVisitor<JsonNode>() {
    @Override
    public JsonNode visit(BooleanValue value) {

代码示例来源:origin: org.n52.sensorweb.sos/coding-wml-v20

(SingleObservationValue<?>) observationValue;
String time = getTimeString(singleObservationValue.getPhenomenonTime());
unit = singleObservationValue.getValue().getUnit();
String value = null;
if (observationValue.getValue() instanceof QuantityValue) {

代码示例来源:origin: org.n52.sensorweb.sos/coding-wml-v20

/**
 * Get the {@link String} representation of {@link Value}
 * 
 * @param value
 *            {@link Value} to get {@link String} representation from
 * @return {@link String} representation of {@link Value}
 */
private String getValue(Value<?> value) {
  if (value != null && value.isSetValue()) {
    if (value instanceof QuantityValue) {
      QuantityValue quantityValue = (QuantityValue) value;
      return Double.toString(quantityValue.getValue().doubleValue());
    } else if (value instanceof ProfileValue) {
      ProfileValue gwglcValue = (ProfileValue)value;
      if (gwglcValue.isSetValue()) {
        return getValue(gwglcValue.getValue().iterator().next().getSimpleValue());
      }       
    } else if (value instanceof CountValue) {
      CountValue countValue = (CountValue) value;
      return Integer.toString(countValue.getValue().intValue());
    } else if (value instanceof TextValue) {
      TextValue textValue = (TextValue) value;
      String nonXmlEscapedText = textValue.getValue();
      return StringEscapeUtils.escapeXml(nonXmlEscapedText);
    }
  }
  return null;
}

代码示例来源:origin: org.n52.sensorweb.sos/hibernate-dao

session
    );
sosValue.getValue().accept(persister);
SeriesDAO seriesDAO = new SeriesDAO();
Series hReferenceSeries = seriesDAO.getSeries(hProcedureReferenceSeries.getIdentifier(),

代码示例来源:origin: org.n52.sensorweb.sos/aqd-split-and-merge

private void mergeValues(OmObservation combinedSosObs, OmObservation sosObservation) {
  SweDataArray combinedValue = (SweDataArray) combinedSosObs.getValue().getValue().getValue();
  SweDataArray value = (SweDataArray) sosObservation.getValue().getValue().getValue();
  if (value.isSetValues()) {
    combinedValue.addAll(value.getValues());
  }
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-wml-v20

List<TimeValuePair> timeValuePairs = tvpValue.getValue();
if (Strings.isNullOrEmpty(unit) && CollectionHelper.isNotEmpty(timeValuePairs)
    && timeValuePairs.get(0).getValue().isSetUnit()) {
  unit = timeValuePairs.get(0).getValue().getUnit();

代码示例来源:origin: org.n52.sensorweb.sos/coding-inspire-omso

if (observationValue instanceof SingleObservationValue) {
  SingleObservationValue<?> singleObservationValue = (SingleObservationValue<?>) observationValue;
  unit = singleObservationValue.getValue().getUnit();
  if (observationValue.getValue() instanceof TimeLocationValueTriple) {

代码示例来源:origin: org.n52.sensorweb.sos/coding-wml-v20

/**
 * Create a array from time values
 * 
 * @param sosObservationValues
 *            SOS multi value observation object
 * @return List with string representations of time values
 * @throws OwsExceptionReport
 *             If an error occurs
 */
private List<String> getTimeArray(MultiObservationValues<?> sosObservationValues) throws OwsExceptionReport {
  TVPValue tvpValue = (TVPValue) sosObservationValues.getValue();
  List<TimeValuePair> timeValuePairs = tvpValue.getValue();
  List<String> toList = Lists.newArrayListWithCapacity(timeValuePairs.size());
  for (TimeValuePair timeValuePair : timeValuePairs) {
    if (timeValuePair.getValue() != null
        && (timeValuePair.getValue() instanceof CountValue || timeValuePair.getValue() instanceof QuantityValue)
        && timeValuePair.getValue().isSetValue()) {
      toList.add(getTimeString(timeValuePair.getTime()));
    }
  }
  return toList;
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-inspire-omso

@Override
protected XmlObject encodeResult(ObservationValue<?> observationValue) throws OwsExceptionReport {
  if (observationValue instanceof SingleObservationValue
      && observationValue.getValue() instanceof TimeLocationValueTriple) {
    if (observationValue.getValue().getValue() instanceof QuantityValue
        || observationValue.getValue().getValue() instanceof CountValue) {
      return createMeasurementTimeseries((AbstractObservationValue<?>) observationValue);
    } else if (observationValue.getValue().getValue() instanceof CategoryValue) {
      return createCategoricalTimeseries((AbstractObservationValue<?>) observationValue);
    } else {
      // TODO throw exception
    }
  } else if (observationValue instanceof MultiObservationValues) {
    if (observationValue.getValue() instanceof TLVTValue) {
      TimeLocationValueTriple value = (TimeLocationValueTriple) ((TLVTValue) observationValue.getValue())
          .getValue().iterator().next();
      if (value.getValue() instanceof QuantityValue || value.getValue() instanceof CountValue) {
        return createMeasurementTimeseries((AbstractObservationValue<?>) observationValue);
      } else if (value.getValue() instanceof CategoryValue) {
        return createCategoricalTimeseries((AbstractObservationValue<?>) observationValue);
      } else {
        // TODO throw exception
      }
    }
  }
  return null;
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-wml-v20

List<TimeValuePair> timeValuePairs = tvpValue.getValue();
if (Strings.isNullOrEmpty(unit) && CollectionHelper.isNotEmpty(timeValuePairs)
    && timeValuePairs.get(0).getValue().isSetUnit()) {
  unit = timeValuePairs.get(0).getValue().getUnit();

代码示例来源:origin: org.n52.sensorweb.sos/coding-inspire-omso

if (observationValue instanceof SingleObservationValue) {
  SingleObservationValue<?> singleObservationValue = (SingleObservationValue<?>) observationValue;
  unit = singleObservationValue.getValue().getUnit();
  if (observationValue.getValue() instanceof TimeLocationValueTriple) {
    categoricalTimeseries.addNewPoint().addNewCategoricalTVP()

代码示例来源:origin: org.n52.sensorweb.sos/coding-uvf

private boolean checkForMultiObservationValue(ObservationValue<?> value) {
  return value instanceof MultiObservationValues<?> && value.getValue().isSetValue()
      && value.getValue() instanceof TVPValue && ((TVPValue)value.getValue()).isSetValue()
      && (((TVPValue)value.getValue()).getValue().get(0).getValue() instanceof CountValue 
          || ((TVPValue)value.getValue()).getValue().get(0).getValue() instanceof QuantityValue);
}

代码示例来源:origin: org.n52.sensorweb.sos/inspire-api

/**
 * Get the point from samplingGeometry or featureOfInterest
 * 
 * @return The {@link Point}
 */
private Point getPoint() {
  Point point = null;
  if (isSetSpatialFilteringProfileParameter()) {
    Geometry geometry = getSpatialFilteringProfileParameter().getValue().getValue();
    point = geometry.getInteriorPoint();
    point.setSRID(geometry.getSRID());
  } else {
    if (getObservationConstellation().getFeatureOfInterest() instanceof AbstractSamplingFeature
        && ((AbstractSamplingFeature) getObservationConstellation().getFeatureOfInterest()).isSetGeometry()) {
      Geometry geometry =
          ((AbstractSamplingFeature) getObservationConstellation().getFeatureOfInterest()).getGeometry();
      point = geometry.getInteriorPoint();
      point.setSRID(geometry.getSRID());
    }
  }
  return point;
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-wml-v20

if (observation.getValue() instanceof SingleObservationValue) {
  SingleObservationValue<?> observationValue = (SingleObservationValue<?>) observation.getValue();
  writeDefaultPointMetadata(observationValue, observationValue.getValue().getUnit());
  writeNewLine();
  String time = getTimeString(observationValue.getPhenomenonTime());

相关文章

微信公众号

最新文章

更多