...
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="ImportDDSC"> <moduleId>TimeSeriesImportRun</moduleId> </moduleInstanceDescriptor> ... </moduleInstanceDescriptors> |
An example of the DDSC import configuration will be given here. The importType is named DDSC which should be configured in the general section of the import. De URL to the rest service should be configured here as well.
Time is assumed to be specified in GMT and data is assumed to be UTF-8 encoded.
To identify the timeseries to import 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.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <timeSeriesImportRun 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/timeSeriesImportRun.xsd"> <import> <general> <importType>DDSC</importType> <serverUrl>https://apiddsc.ddsclizard.nlnet/api/v2/timeseries/timeseries<</serverUrl> <user>user<<user>dummy_username</user> <password>pw<<password>dummy_password</password> <relativeViewPeriod unit="day" start="-14300" end="0" startOverrulable="true" endOverrulable="false"/> <idMapId>IdImportDDSC</idMapId> <unitConversionsId>ImportUnitConversions</unitConversionsId> <missingValue>-9999</missingValue> <dataFeedId>DDSC</dataFeedId> <convertDatum>true</convertDatum> </general> <properties> <!-- -map parameter,location combinations to unique timeseries uuid's of ddsc --> <string key="SH,Amsterdam" value="cc0a8831-7758-4dd6-999c-f607c026d176"/> </properties> <timeSeriesSet> <moduleInstanceId>ImportDDSC</moduleInstanceId> <valueType>scalar</valueType> <parameterId>SH</parameterId> <locationSetId>DAM_SUB<<locationId>Amsterdam</locationSetId>locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> <synchLevel>1</synchLevel> </timeSeriesSet> </import> </timeSeriesImportRun> |
The IdMapping configuration idImportDDSC.xml is very important because this maps the internal FEWS Id's to the REST Id's. An example IdMapping file for the DDSC importer is shown below.
Code Block | |
---|---|
xml | xml|
<?xml version="1.0" encoding="UTF-8"?>
<idMap version="1.1" 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/idMap.xsd">
....
<parameter external="SH" internal="SH"/>
<parameter external="TEMP" internal="T_meting_grondwater"/>
<parameter external="WSP" internal="Waterspanning"/>
<locationIdFunction internalLocationSet="DAM_SUB" externalLocationFunction="@DDSC_LOC@"/>
....
</idMap>
|
Example JSON file for timeseries
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "count": 1, "next": null, "previous": null, "results": [ { "url": "https://apiddsc.ddsclizard.nlnet/api/v2/timeseries/b6903937cc0a8831-14e47758-49264dd6-8e84999c-158185d4f32cf607c026d176/", "id": 2023120339, "uuid": "b6903937cc0a8831-14e47758-49264dd6-8e84999c-158185d4f32cf607c026d176", "name": "OMZD_29,9_BARO1468.0000", "organisation_code": "b6903937cc0a8831-14e47758-49264dd6-8e84999c-158185d4f32cf607c026d176", description: "Part of group Ten Cate Fiber Temperature", value_type": "float", "location": { "url": "https://apiddsc.ddsclizard.nlnet/api/v2/locations/cef6e07ecc0a8831-cfe97758-44514dd6-9caa999c-6cd5cdb106a0f607c026d176/", id: "uuid": "cef6e07e-cfe9-4451-9caa-6cd5cdb106a0", "name": "OMZD meetraai DP29,9", "organisation": { "url"10378, uuid: "cc0a8831-7758-4dd6-999c-f607c026d176", name: "1468.0000", organisation_code: "cc0a8831-7758-4dd6-999c-f607c026d176", geometry: { type: "Point", coordinates: [ 4.8690924967, 52.1030364306, 0 ] }, organisation: { url: "https://apiddsc.ddsclizard.nlnet/api/v2/organisations/8e94ef601f0546a6adf74440d2ce856ac9c9dd6349ac4c7ebd434906dd90f671/", "name": "NoorderzijlvestHDSR", "unique_id": "8e94ef601f0546a6adf74440d2ce856ac9c9dd6349ac4c7ebd434906dd90f671", "users_url": "https://apiddsc.ddsclizard.nlnet/api/v2/organisations/8e94ef601f0546a6adf74440d2ce856ac9c9dd6349ac4c7ebd434906dd90f671/users/" }, access_modifier: "organisation_code": "cef6e07e-cfe9-4451-9caa-6cd5cdb106a0" }, ""Common", ddsc_show_on_map: false, ddsc_icon_url: "/app/images/marker-dam-3.png", extra_metadata: { description: "Part of group Ten Cate Fiber Temperature", ddsc: true } }, parameter_referenced_unit": { "url": "https://apiddsc.ddsclizard.nlnet/api/v2/parameterreferencedunits/355320/", "code": "DRUK (mbar) LTWNS6529", "parameter_short_display_name": "DrukTemperatuur", "referenced_unit_short_display_name": "mbaroC", "description": "", "domain_values": null }, "access_modifier"device: "Common", "supplier"extra_metadata: { "url"compartment: "https://api.ddsc.nl/api/v2/users/224/BS", "username": "erik.peters", "first_name": "Erik", "last_name": "Peters", "email": "e.peters@alertsolutions.nl", "organisations_url": "https://api.ddsc.nl/api/v2/users/224/organisations/" }, "supplier_code": "0201400D41912C8F.0P", "ddsc: true }, access_modifier: "Common", supplier: null, supplier_code: null, first_value_timestamp": 13721602080001366893402000, "last_value_timestamp": 14497201700001435907838000, "last_value": 1030.05, "events": [ { "timestamp": 1449366444000, "max": 1013.6, "min": 1013.6 }, { "timestamp": 1449367344000, "max": 1013.58, "min": 1013.58 }, { "timestamp": 1449460953000, "max": 1025.25, "min": 1025.25 }, { "timestamp": 1449532960000, "max": 1029.21, "min": 1029.21 }, { "timestamp": 1449568964000, "max": 1026.28, "min": 1026.28 }, { "timestamp": 1449662572000, "max": 1032.85, "min": 1032.85 }, { "timestamp": 1449712971000, "max": 1031.05, "min": 1031.05 }, { "timestamp": 1449713871000, "max": 1030.65, "min": 1030.65 }, { "timestamp": 1449714771000, "max": 1030.54, "min": 1030.54 }, { "timestamp": 1449715671000, "max": 1030.52, "min": 1030.52 }, { "timestamp": 1449716571000, "max": 1030.47, "min": 1030.47 }, { "timestamp": 1449717471000, "max": 1030.35, "min": 1030.35 }, { "timestamp": 1449718371000, "max": 1030.33, "min": 1030.33 }, { "timestamp": 1449719271000, "max": 1030.23, "min": 1030.23 }, { "timestamp": 1449720170000, "max": 1030.05, "min": 1030.05 } ] } ] } |
Java source code
DdscTimeSeriesServerParser.java
: -28.9631,
threshold_min_soft: null,
threshold_min_hard: null,
threshold_max_soft: null,
threshold_max_hard: null,
created: 1364985111394,
last_modified: null,
last_modified_by: "",
events: [
{
timestamp: 1421817438000,
max: -34.2868,
min: -34.2868
},
{
timestamp: 1421821038000,
max: -34.2108,
min: -34.2108
},
{
timestamp: 1421824638000,
max: -34.3991,
min: -34.3991
},
]
}
|
Java source code
DdscTimeSeriesServerParser.java