Overview
The DDSC Export export timeseries to the Dijkdata the Dijkdata Service Center (DDSC). NOT YET AVAILABLE.
See: https://portal.ddsc.nl/.
The DDSC export function (<exportType>DDSC</exportType>) imports from the following REST service: https://api.ddsc.nl/api/v2/.
For documentation on the API see: https://ddsc.lizard.net/doc/api.html.
Configuring the export
To make the export known to FEWS, the export module has to be declared in the moduleInstanceDescriptors.xml in the RegionConfigFiles directory of the FEWS configuration:
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?>
<moduleInstanceDescriptors xmlns="http://www.wldelft.nl/fews"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wldelft.nl/fews
http://fews.wldelft.nl/schemas/version1.0/moduleInstanceDescriptors.xsd" version="1.0">
...
<moduleInstanceDescriptor id="ExportDDSC">
<moduleId>TimeSeriesExportRun</moduleId>
</moduleInstanceDescriptor>
...
</moduleInstanceDescriptors>
|
An example of the DDSC import configuration will be given here. The exportType is named DdscExport which should be configured in the general section of the export. De URL to the rest service should be configured here as well.
Time is assumed to be specified in GMT.
To identify the timeseries to export the unique uuid of the timeseries have to be specified. This is done in the properties sections where parameterId and locationId are mapped to a uuid value. The relative view period of a timeSeriesSet determines the timeSeries to export to the DDSC.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesExportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews
http://fews.wldelft.nl/schemas/version1.0/timeSeriesExportRun.xsd">
<export>
<general>
<exportType>DdscExport</exportType>
<serverUrl>https://api.ddsc.nl/api/v2/timeseries/</serverUrl>
<user>deltares_ddsc</user>
<password>r2OJMYJC4a</password>
<unitConversionsId>ImportUnitConversions</unitConversionsId>
</general>
<properties>
<!-- -map parameter,location combinations to unique timeseries uuid's of ddsc -->
<string key="Q.observed,Brasilia" value="f9295f20-de55-40d4-a356-61f6f142a36f"/>
</properties>
<timeSeriesSet>
<moduleInstanceId>ImportDDSC</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>Q.observed</parameterId>
<locationId>Brasilia</locationId>
<timeSeriesType>external historical</timeSeriesType>
<timeStep unit="nonequidistant"/>
<relativeViewPeriod unit="day" start="-300" end="0" startOverrulable="true" endOverrulable="false"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>1</synchLevel>
</timeSeriesSet>
</export>
</timeSeriesExportRun> |
Configuring DDSC Locations and TimeSeries
Before timeseries from FEWS can be exported to the DDSC, import data into the DDSC service locations and timeseries have to be created manually first. (Using a REST tool like "Advanced REST Client" can do the job).
Creating locations:
Code Block | ||
---|---|---|
| ||
POST https://api.ddsc.nl/api/v2/locations/ HTTP/1.1 Host: api.ddsc.nl username: ddsc_username password: ddsc_password Content-Type: application/json Accept: application/json { "name": "28_5", "organisation": "a73d02c3280047a89d4d362df1914352", "organisation_code": "28_5", "geometry": null, "access_modifier": 0, "ddsc_icon_url": "", "ddsc_show_on_map": false, "extra_metadata": null } |
...
The location is returned:
Code Block |
---|
{ "url": "https://api.ddsc.nl/api/v2/locations/73fd0765-86fb-40b9-a917-ecb59f5dc14b/" "uuid": "73fd0765-86fb-40b9-a917-ecb59f5dc14b" "name": "28_5" "organisation": "a73d02c3280047a89d4d362df1914352" "organisation_code": "28_5" "geometry": null "access_modifier": "Public" "ddsc_icon_url": "" "ddsc_show_on_map": false "extra_metadata": null "last_modified": "2016-02-19T16:01:17.699333" "last_modified_by": "deltares_ddsc" } |
Creating a new timeseries for storing events"
Code Block |
---|
POST https://api.ddsc.nl/api/v2/timeseries/ Host: api.ddsc.nl username: ddsc_username password: ddsc_password Content-Type: application/json Accept: application/json { "name": "timeserie_28_0", "description": "timeserie_28_0", "location": "b8db040c-4edc-4983-81df-32b2f3216bfc", "organisation_code": "timeserie_28_0", "device": "", "supplier": null, "supplier_code": null, "access_modifier": "Public", "value_type":1, "parameter_referenced_unit": "H.meting", "threshold_min_soft": null, "threshold_min_hard": null, "threshold_max_soft": null, "threshold_max_hard": null } |
The result of this post returns the uuid of this timeseries.
Code Block |
---|
{ "url": "https://api.ddsc.nl/api/v2/timeseries/414c320b-d965-4888-8b9c-cf587a82dacb/" "id": 40314 "uuid": "414c320b-d965-4888-8b9c-cf587a82dacb" "name": "timeserie_28_0" "description": "timeserie_28_0" "location": "b8db040c-4edc-4983-81df-32b2f3216bfc" "organisation_code": "timeserie_28_0" "device": "" "supplier": null "supplier_code": null "access_modifier": "Public" "value_type": "float" "parameter_referenced_unit": "H.meting" "threshold_min_soft": null "threshold_min_hard": null "threshold_max_soft": null "threshold_max_hard": null "last_modified": "2016-02-19T16:20:56.768927" "last_modified_by": "deltares_ddsc" "extra_metadata": null } |
Posting events to the timeseries can be done with:
POST https://api.ddsc.nl/api/v2/timeseries/f9295f20-de55-40d4-a356-61f6f142a36f/data/
Where uuid is the uuid of the timeseries.
The POST content can be JSON according the following format:
Code Block |
---|
[ {"value": "2.0123", "datetime": "2013-02-12T09:56:12Z"}, {"value": "2.0123", "datetime": "2013-02-13T09:56:12Z"} ] |
This will return the following response:
Code Block |
---|
[{"datetime":"2013-02-12T09:56:12Z","value":"2.0123"},{"datetime":"2013-02-13T09:56:12Z","value":"2.0123"}] |
For posting to image a new timeseries of value type 5 has to be created where the uuid of the location is specified. This way they can be related to each other.
Creating an "image" time series can be done as follows:
Code Block |
---|
POST https://api.ddsc.nl/api/v2/timeseries/ Host: api.ddsc.nl username: ddsc_username password: ddsc_password Content-Type: application/json Accept: application/json { "name": "timeserie_image_28_0", "description": "timeserie_28_0", "location": "b8db040c-4edc-4983-81df-32b2f3216bfc", "organisation_code": "timeserie_image_28_0", "device": "", "supplier": null, "supplier_code": null, "access_modifier": "Public", "value_type":5, "parameter_referenced_unit": "H.meting", "threshold_min_soft": null, "threshold_min_hard": null, "threshold_max_soft": null, "threshold_max_hard": null } |
The uuid of this series is returned in the response:
Code Block |
---|
{ "url": "https://api.ddsc.nl/api/v2/timeseries/9d7dbcdc-e6a7-41e9-8870-eacdf80e18fc/" "id": 40315 "uuid": "9d7dbcdc-e6a7-41e9-8870-eacdf80e18fc" "name": "timeserie_image_28_0" "description": "timeserie_28_0" "location": "b8db040c-4edc-4983-81df-32b2f3216bfc" "organisation_code": "timeserie_image_28_0" "device": "" "supplier": null "supplier_code": null "access_modifier": "Public" "value_type": "image" "parameter_referenced_unit": "H.meting" "threshold_min_soft": null "threshold_min_hard": null "threshold_max_soft": null "threshold_max_hard": null "last_modified": "2016-02-19T16:23:46.071265" "last_modified_by": "deltares_ddsc" "extra_metadata": null } |
The images can now be posted to:
POST https://api.ddsc.nl/api/v2/timeseries/(uuid: uuid)/data/
In the header user name and password should be specified and datetime as well. Only one image per datetime can be posted.
Code Block |
---|
Code Block |
---|
|