Skip to content

QueryResult

Example

{
  "datasetId": "string",
  "elements": [
    {
      "i": 0,
      "v": [
        [
          0
        ]
      ]
    }
  ],
  "timeSteps": ["2021-03-04T10:56:01.720Z"], 
  "dataBlocks": [
    {
      "itemIndex": 0, 
      "timeIndex": 0, 
      "elementIndex": 0,  //only in timeseries result
      "layerIndex": 0,
      "data": [0]
    }
  ]
}
  class MultidimensionalQueryResult<T> where T : BaseDataBlockFloat
  {
      public Guid DatasetId { get; set; }
      public IEnumerable<ISpatialElement> Elements { get; set; }
      public IEnumerable<T> DataBlocks { get; set; }
      public int? Srid { get; set; }
  }

  class BaseDataBlockFloat
  {
      public int ItemIndex { get; set; }
      public int LayerIndex { get; set; }
      public float[] Data { get; set; }
  }

Elements

Array of objects:

- i : element index
- v : array of element node coordinates
foreach (var element in result.Elements)
{
    var geometry = element.GetGeometry(dataset.SpatialDomain);
    //returns NetTopologySuite geometry class based on the spatial domain type
}

Datablocks

Each datablock contains float data array reppresnting item data slice defined by its indexes. A data block always includes:

  • itemIndex : index of item in dataset defintion
  • layerIndex : vertical layer index, if undefined value is -1
  • data : contains array of float values ordered by elements or timesteps based on query type

Datablocks are not ordered by any index and clients should sort them as they need.