<?xml version="1.0" encoding="UTF-8"?>
<toolchain saga-version="2.2.4">
	<group>tta_tools</group>
	<identifier>tta_TravelTime</identifier>
	<name>Travel Time Calculation</name>
	<author>R.Fisher (c) 2015</author>
	<description>
		Perform travel time calculation.

		Find further information at Rohan Fisher's web page on &lt;a href="http://rohanfisher.wordpress.com/travel-time-modelling-saga/"&gt;Travel Time Modelling with SAGA&lt;/a&gt;.
	</description>
	<reference>
		<authors>Fisher, R., and Lassa, J.</authors>
		<year>2017</year>
		<title>Interactive, open source, travel time scenario modelling: tools to facilitate participation in health service access analysis</title>
		<where>International Journal of Health Geographics, 16(13).</where>
		<doi>10.1186/s12942-017-0086-8</doi>
	</reference>
	<reference>
		<authors>Ray, N., and Ebener, S.</authors>
		<year>2008</year>
		<title>AccessMod 3.0: computing geographic coverage and accessibility to health care services using anisotropic movement of patients</title>
		<where>International Journal of Health Geographics, 7(63).</where>
		<doi>10.1186/1476-072X-7-63</doi>
	</reference>

	<parameters>
		<input varname="DESTINATIONS" type="shapes">
			<name>Destination Points</name>
		</input>
		<option varname="GRID_SYSTEM" type="grid_system">
			<name>Grid System</name>
		</option>
		<input varname="LANDCOVER" type="grid" parent="GRID_SYSTEM">
			<name>Land Cover</name>
		</input>
		<input varname="LANDCOVER_TO_TRAVELTIME" type="table">
			<name>Travel Times</name>
			<description>This table supplies average travel times through a cell (in seconds) for each land cover type</description>
		</input>
		<input varname="FIELD_LANDCOVER" type="table_field" parent="LANDCOVER_TO_TRAVELTIME">
			<name>Land Cover ID</name>
		</input>
		<input varname="FIELD_TRAVELTIME" type="table_field" parent="LANDCOVER_TO_TRAVELTIME">
			<name>Travel Time</name>
		</input>
		<output varname="TRAVELTIME_MINUTES" type="grid" parent="GRID_SYSTEM">
			<output_name>Travel Time</output_name>
			<name>Travel Time</name>
			<unit>Minutes</unit>
			<colours revert="TRUE">16</colours>
		</output>
		<input varname="TRAVELTIME_LUT" type="table" optional="true">
			<name>Travel Time Zones Classification</name>
			<description>Look-up table for classification of travel time zones.</description>
		</input>
	</parameters>

	<tools>
		<tool library="grid_tools" tool="15" name="Reclassify Grid Values">
			<option id="NODATAOPT">true</option>
			<option id="NODATA">-99999</option>
			<option id="RESULT_NODATA_CHOICE">1</option>
			<option id="RESULT_NODATA_VALUE">-99999</option>
			<option id="RESULT_TYPE">6</option>
			<option id="METHOD">3</option>
			<option id="TOPERATOR">1</option>
			<option id="F_MIN"  varname="TRUE">FIELD_LANDCOVER</option>
			<option id="F_MAX"  varname="TRUE">FIELD_LANDCOVER</option>
			<option id="F_CODE" varname="TRUE">FIELD_TRAVELTIME</option>
			<input  id="INPUT">LANDCOVER</input>
			<input  id="RETAB_2">LANDCOVER_TO_TRAVELTIME</input>
			<output id="RESULT">TRAVELTIME_LOCAL</output>
		</tool>
		<tool library="grid_analysis" tool="0" name="Accumulated Cost">
			<option id="THRESHOLD">0.000000</option>
			<option id="DEST_TYPE">0</option>
			<input  id="COST">TRAVELTIME_LOCAL</input>
			<input  id="DEST_POINTS">DESTINATIONS</input>
			<output id="ACCUMULATED">TRAVELTIME_ACCUMULATED</output>
		</tool>
		<tool library="grid_calculus" tool="1" name="Grid Calculator">
			<option id="FORMULA">g1/60</option>
			<option id="TYPE">7</option>
			<input  id="GRIDS">TRAVELTIME_ACCUMULATED</input>
			<output id="RESULT">TRAVELTIME_MINUTES</output>
		</tool>
		
		<condition type="exists" variable="TRAVELTIME_LUT">
			<tool library="grid_visualisation" tool="10" name="Select Look-up Table for Grid Visualization">
				<input id="GRID">TRAVELTIME_MINUTES</input>
				<input id="LUT">TRAVELTIME_LUT</input>
			</tool>
		</condition>
	</tools>
</toolchain>
