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. 

...

Code Block
linenumberstrue
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2014 rel. 2 sp1 (http://www.altova.com) by Afdeling ICT (Stichting Deltares) -->
<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://weather.bangkok.go.th/dds_webservices/api/rain/lastdata</serverUrl>
			<!--         this field is not used, but it is necessary to be able to configure connection timout-->
			<backupServerUrl>http://weather.bangkok.go.th/dds_webservices/api/rain/lastdata</backupServerUrl>
			<!--         if this field is not configured, it will be set at 10000 automatically. -->			
			<connectionTimeOutMillis>1000000</connectionTimeOutMillis>FEWS-23686/lastdata</serverUrl>
			<user>User</user>
			<password>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>

...