You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Overview

The Akvo import function (<importType>Akvo</importType>) imports from the Akvo FLow REST service: https://github.com/akvo/akvo-flow/wiki/Akvo-FLOW-API

During the import all registration site id's are logged by FEWS. They can be used to register the FEWS location ids.

Configuring the Import

An example of the Akvo import configuration will be given here. The importType is named Akvo 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.

<?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>Akvo</importType>
			<serverUrl>https://akvoflow-141.appspot.com/api/v1</serverUrl>
			<user>AKVO_ACCESS_KEY</user> <!-- akvo access key -->
			<password>AKVO_SECRET</password> <!-- akvo secret -->
			<relativeViewPeriod unit="day" start="-20" end="0" startOverrulable="true" endOverrulable="false"/> <!-- read all survey instances of the last 20 days -->
			<idMapId>idAkvo</idMapId>
		</general>
		<properties>
			<string value="1100001" key="siteRegistrationSurveyId"></string>
			<string value="170003" key="sitMonitoringSurveyId"></string>
		</properties>
		<timeSeriesSet>
			<moduleInstanceId>ImportAkvo</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>pH</parameterId>
			<locationId>b1b2-8xh1-pt21</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant" />
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
		<timeSeriesSet>
			<moduleInstanceId>ImportAkvo</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>pH</parameterId>
			<locationId>4yes-fjqk-ceh5</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant" />
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
		<timeSeriesSet>
			<moduleInstanceId>ImportAkvo</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>pH</parameterId>
			<locationId>ycwm-vu8j-2ts1</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant" />
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>

 

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="ImportAkvo">
		<moduleId>TimeSeriesImportRun</moduleId>
	</moduleInstanceDescriptor>
...
</moduleInstanceDescriptors>
  • No labels