Overview

The DDSC import function (<importType>DDSC</importType>) imports from the following REST service: https://api.ddsc.nl/api/v2/

Configuring the Import

To make the importer known to FEWS, the import module has to be declared in the moduleInstanceDescriptors.xml in the RegionConfigFiles directory of the FEWS configuration:

<?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.

<?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://ddsc.lizard.net/api/v2/timeseries/</serverUrl>
			<user>dummy_username</user>
			<password>dummy_password</password>
			<relativeViewPeriod unit="day" start="-300" end="0" startOverrulable="true" endOverrulable="false"/>
			<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>
			<locationId>Amsterdam</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant"/>
			<readWriteMode>add originals</readWriteMode>
			<synchLevel>1</synchLevel>
		</timeSeriesSet>
	</import>


</timeSeriesImportRun>

Example JSON file for timeseries


{
url: "https://ddsc.lizard.net/api/v2/timeseries/cc0a8831-7758-4dd6-999c-f607c026d176/",
id: 20339,
uuid: "cc0a8831-7758-4dd6-999c-f607c026d176",
name: "1468.0000",
organisation_code: "cc0a8831-7758-4dd6-999c-f607c026d176",
description: "Part of group Ten Cate Fiber Temperature",
value_type: "float",
location: {
url: "https://ddsc.lizard.net/api/v2/locations/cc0a8831-7758-4dd6-999c-f607c026d176/",
id: 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://ddsc.lizard.net/api/v2/organisations/c9c9dd6349ac4c7ebd434906dd90f671/",
name: "HDSR",
unique_id: "c9c9dd6349ac4c7ebd434906dd90f671",
users_url: "https://ddsc.lizard.net/api/v2/organisations/c9c9dd6349ac4c7ebd434906dd90f671/users/"
},
access_modifier: "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://ddsc.lizard.net/api/v2/parameterreferencedunits/320/",
code: "WNS6529",
parameter_short_display_name: "Temperatuur",
referenced_unit_short_display_name: "oC",
description: "",
domain_values: null
},
device: "",
extra_metadata: {
compartment: "BS",
ddsc: true
},
access_modifier: "Common",
supplier: null,
supplier_code: null,
first_value_timestamp: 1366893402000,
last_value_timestamp: 1435907838000,
last_value: -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




  • No labels