Skip to content

Import DFS data and execute query using SDK

See SDK docs for details on how to use SDK.

Import local file data to the cloud project

Project for upload must already exist.

var upload = await transferClient
    .CreateFileImport(projectId, "C:\\Data\\EqD2.dfs2")
    .ExecuteAndWaitAsync();

Query imported dataset

Query first item, first timestep data in 2 positions.

var input = new QueryInput
{
    ItemFilter = new ItemFilter { ItemIndices = new int[] { 0 } },
    TemporalFilter = new TemporalIndexFilter { From = 0, To = 0 }
    SpatialFilter = new SpatialFilter { Geometry = "MULTIPOINT ((2 51.7),(2.4 51.8))" }
};
var result = await _mdClient.QueryTimesteps(projectId, upload.DatasetId, input);

Read data from DataBlocks collection

Query first item, first timestep data in 2 positions.

var data=result.DataBlocks.First().Data;

var valueInPoint1=data[0];
var valueInPoint2=data[1];

For more details read the How to guides section.