This Import function is included in the Delft-FEWS version 2020.02 and later. The Import function imports JSON files from a http server in Bangkok. There are two parsers for the same http server:

  • BMADay: import receives the last 24 hours of data for a selected location.
  • BMALatest: imports only the last data value for all locations of the same type.


Example url request:

http://$Server$/rain/History?id=RF.PNK.01

This request returns the data of the last 24 hours for one location.


Example configuration:

<?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>BMADay</importType>
			<serverUrl>http://$Server$/flow/History?id=</serverUrl>
			<user>dummy_username</user>
			<password>dummy_password</password>
			<relativeViewPeriod unit="day" start="-2" end="1" startOverrulable="true" endOverrulable="true"/>
			<idMapId>BMADayMap</idMapId>
			<missingValue>-999.0</missingValue>
		</general>
		<timeSeriesSet>
			<moduleInstanceId>BMADay</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>param</parameterId>
			<locationId>LocA</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant"/>
			<readWriteMode>add originals</readWriteMode>
			<synchLevel>1</synchLevel>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>


Response example:

[
    {
        "code": "RF.PNK.01",
        "site_time": "2021-03-25T15:25:00",
        "rf5min": 0.0,
        "rf15min": 0.0,
        "rf30min": 0.0,
        "rf1hr": 0.0,
        "rf3hr": 0.0,
        "rf6hr": 0.0,
        "rf12rh": 0.0,
        "rf24rh": 0.0
    },
    {
        "code": "RF.PNK.01",
        "site_time": "2021-03-25T15:30:00",
        "rf5min": 0.0,
        "rf15min": 0.0,
        "rf30min": 0.0,
        "rf1hr": 0.0,
        "rf3hr": 0.0,
        "rf6hr": 0.0,
        "rf12rh": 0.0,
        "rf24rh": 0.0
    }
]
  • No labels