Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Available since This Import function is included in the Delft-FEWS version 2020.02 . Present parser allows to download and import meteorological observations from http://weather.bangkok.go.th/dds_webservices/apiand 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://weather.bangkok.go.th/dds_webservices/api/rain$Server$/lastdata

This request returns the latest data point for all locations available. 


Example configuration:

...

Code Block

...

linenumberstrue
<?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>BMALatest</importType>
			<serverUrl>http://

...

$Server$/lastdata</serverUrl>
			

...

<user>dummy_username</user>
			

...

<password>dummy_password</password>
			<relativeViewPeriod unit="day" start="-2" end="1" startOverrulable="true" endOverrulable="true"/>
			<idMapId>BMALatestMap</idMapId>
			<missingValue>-999.0</missingValue>
		</general>
		<timeSeriesSet>
			<moduleInstanceId>BMALatest</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>param1</parameterId>
			<locationId>LocA</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant"/>
			<readWriteMode>add originals</readWriteMode>
			<synchLevel>1</synchLevel>
		</timeSeriesSet>
		<timeSeriesSet>
			<moduleInstanceId>BMALatest</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>param1</parameterId>
			<locationId>LocB</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant" />
			<readWriteMode>add originals</readWriteMode>
			<synchLevel>1</synchLevel>
		</timeSeriesSet>
		<timeSeriesSet>
			<moduleInstanceId>BMALatest</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>param2</parameterId>
			<locationId>LocA</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant" />
			<readWriteMode>add originals</readWriteMode>
			<synchLevel>1</synchLevel>
		</timeSeriesSet>
		<timeSeriesSet>
			<moduleInstanceId>BMALatest</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>param2</parameterId>
			<locationId>LocB</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant" multiplier="1"/>
			<readWriteMode>add originals</readWriteMode>
			<synchLevel>1</synchLevel>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>


Response example:

...

Code Block

...

linenumberstrue
[
    {
        "code": 

...

"RF.PNK.01",

...


        "site_time":

...

 "2021-03-26T14:35: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.PPS.01",

...


        "site_time":

...

 "2021-03-26T14:40: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

...


    }
]