lib/Models/SensorObservationServiceCatalogItem.js
function extractValues(response) {
    var observationData =
      response.GetObservationResponse &&
      response.GetObservationResponse.observationData;
    if (defined(observationData)) {
      if (!Array.isArray(observationData)) {
        observationData = [observationData];
      }
      var observations = observationData.map(o => o.OM_Observation);
      observations.forEach(observation => {
        if (!defined(observation)) {
          return;
        }
        var points = observation.result.MeasurementTimeseries.point;
        if (!defined(points)) {
          return;
        }
        if (!Array.isArray(points)) {
          points = [points];
        }
        var measurements = points.map(point => point.MeasurementTVP); // TVP = Time value pairs, I think.
        // var procedureTitle = defined(observation.procedure) ? observation.procedure['xlink:title'] : 'value';
        // var featureName = observation.featureOfInterest['xlink:title'];
        var featureIdentifier = observation.featureOfInterest["xlink:href"];
        dateValues.push(
          ...measurements.map(measurement =>
            typeof measurement.time === "object" ? null : measurement.time
          )
        );
        valueValues.push(
          ...measurements.map(measurement =>
            typeof measurement.value === "object"
              ? null
              : parseFloat(measurement.value)
          )
        );
        // These 5 arrays constitute columns in the table, some of which (like this one) have the same
        // value in each row.
        featureValues.push(...measurements.map(_ => featureIdentifier));
        procedureValues.push(...measurements.map(_ => procedure.identifier));
        observedPropertyValues.push(
          ...measurements.map(_ => observableProperty.identifier)
        );
      });
    }
  }
function extractValues(response) {
    var observationData =
      response.GetObservationResponse &&
      response.GetObservationResponse.observationData;
    if (defined(observationData)) {
      if (!Array.isArray(observationData)) {
        observationData = [observationData];
      }
      var observations = observationData.map(o => o.OM_Observation);
      observations.forEach(observation => {
        if (!defined(observation)) {
          return;
        }
        var points = observation.result.MeasurementTimeseries.point;
        if (!defined(points)) {
          return;
        }
        if (!Array.isArray(points)) {
          points = [points];
        }
        var measurements = points.map(point => point.MeasurementTVP); // TVP = Time value pairs, I think.
        // var procedureTitle = defined(observation.procedure) ? observation.procedure['xlink:title'] : 'value';
        // var featureName = observation.featureOfInterest['xlink:title'];
        var featureIdentifier = observation.featureOfInterest["xlink:href"];
        dateValues.push(
          ...measurements.map(measurement =>
            typeof measurement.time === "object" ? null : measurement.time
          )
        );
        valueValues.push(
          ...measurements.map(measurement =>
            typeof measurement.value === "object"
              ? null
              : parseFloat(measurement.value)
          )
        );
        // These 5 arrays constitute columns in the table, some of which (like this one) have the same
        // value in each row.
        featureValues.push(...measurements.map(_ => featureIdentifier));
        procedureValues.push(...measurements.map(_ => procedure.identifier));
        observedPropertyValues.push(
          ...measurements.map(_ => observableProperty.identifier)
        );
      });
    }
  }
function extractValues ( response ) { var observationData = response . GetObservationResponse && response . GetObservationResponse . observationData ; if ( defined ( observationData ) ) { if ( ! Array . isArray ( observationData ) ) { observationData = [ observationData ] ; } var observations = observationData . map ( o => o . OM_Observation ) ; observations . forEach ( observation => { if ( ! defined ( observation ) ) { return ; } var points = observation . result . MeasurementTimeseries . point ; if ( ! defined ( points ) ) { return ; } if ( ! Array . isArray ( points ) ) { points = [ points ] ; } var measurements = points . map ( point => point . MeasurementTVP ) ; // TVP = Time value pairs, I think. // var procedureTitle = defined(observation.procedure) ? observation.procedure['xlink:title'] : 'value'; // var featureName = observation.featureOfInterest['xlink:title']; var featureIdentifier = observation . featureOfInterest [ "xlink:href" ] ; dateValues . push ( ... measurements . map ( measurement => typeof measurement . time === "object" ? null : measurement . time ) ) ; valueValues . push ( ... measurements . map ( measurement => typeof measurement . value === "object" ? null : parseFloat ( measurement . value ) ) ) ; // These 5 arrays constitute columns in the table, some of which (like this one) have the same // value in each row. featureValues . push ( ... measurements . map ( _ => featureIdentifier ) ) ; procedureValues . push ( ... measurements . map ( _ => procedure . identifier ) ) ; observedPropertyValues . push ( ... measurements . map ( _ => observableProperty . identifier ) ) ; } ) ; } }
Iterate over all the points in all the time series in all the observations in all the bodies to get individual result rows.
Iterate over all the points in all the time series in all the observations in all the bodies to get individual result rows .