DOI: 10.7910/dvn/6jr87x
title: GEE-TED: A tsetse ecological distribution model for Google Earth Engine

description: &lt;b&gt;GEE-TED: A tsetse ecological distribution model for Google Earth Engine&lt;/b&gt;
&lt;br&gt;&lt;br&gt;
&lt;i&gt;Please refer to the associated publication:&lt;/i&gt;
&lt;br&gt;
Fox, L., Peter, B.G., Frake, A.N. and Messina, J.P., 2023. A Bayesian maximum entropy model for predicting tsetse ecological distributions. &lt;i&gt;International Journal of Health Geographics&lt;/i&gt;, 22(1), p.31.
&lt;br&gt;
&lt;a href="https://link.springer.com/article/10.1186/s12942-023-00349-0"&gt;https://link.springer.com/article/10.1186/s12942-023-00349-0&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
&lt;b&gt;Description&lt;/b&gt;
&lt;br&gt;
GEE-TED is a Google Earth Engine (GEE; Gorelick et al. 2017) adaptation of a tsetse ecological distribution (TED) model developed by DeVisser et al. (2010), which was designed for use in ESRI's ArcGIS. TED uses time-series climate and land-use/land-cover (LULC) data to predict the probability of tsetse presence across space based on species habitat preferences (in this case &lt;i&gt;Glossina Morsitans&lt;/i&gt;). Model parameterization includes (1) day and night temperatures (MODIS Land Surface Temperature; MOD11A2), (2) available moisture/humidity using a vegetation index as a proxry (MODIS NDVI; MOD13Q1), (3) LULC (MODIS Land Cover Type 1; MCD12Q1), (4) year selections, and (5) fly movement rate (meters/16-days). TED has also been used as a basis for the development of an agent-based model by Lin et al. (2015) and in a cost-benefit analysis of tsetse control in Tanzania by Yang et al. (2017). 
&lt;br&gt;&lt;br&gt;
&lt;i&gt;Parameterization in Fox et al. (2023):&lt;/i&gt;
&lt;br&gt;
Suitable LULC types and climate thresholds used here are specific to &lt;i&gt;Glossina Morsitans&lt;/i&gt; in Kenya and are based on the parameterization selections in DeVisser et al. (2010) and DeVisser and Messina (2009). Suitable temperatures range from 17–40°C during the day and 10–40°C at night and available moisture is characterized as NDVI &gt; 0.39. Suitable LULC comprises predominantly woody vegetation; a complete list of suitable categories is available in DeVisser and Messina (2009). In the Fox et al. (&lt;i&gt;Forthcoming&lt;/i&gt;) publication, two versions of MCD12Q1 were used to assess suitable LULC types: Versions 051 and 006. The GeoTIFF supplied in this dataset entry (GEE-TED_Kenya_2016-2017.tif) uses the aforementioned parameters to show the probable tsetse distribution across Kenya for the years 2016-2017. A static graphic of this GEE-TED output is shown below and an interactive version can be viewed at: &lt;a href="https://cartoscience.users.earthengine.app/view/gee-ted"&gt;https://cartoscience.users.earthengine.app/view/gee-ted&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;
&lt;img src ="https://github.com/cartoscience/vector-suit/blob/main/images/GEE-TED_Kenya_2016-2017_HD.png?raw=true" width="1000" height="auto"&lt;/img&gt;
&lt;i&gt;Figure associated with Fox et al. (2023)&lt;/i&gt;
&lt;br&gt;&lt;br&gt;
&lt;b&gt;GEE code&lt;/b&gt;
&lt;br&gt;
The code supplied below is generalizable across geographies and species; however, it is highly recommended that parameterization is given considerable attention to produce reliable results. Note that output visualization on-the-fly will take some time and it is recommended that results be exported as an asset within GEE or exported as a GeoTIFF. &lt;i&gt;Note&lt;/i&gt;: Since completing the Fox et al. (2023) manuscript, GEE has removed Version 051 per NASA's deprecation of the product. The current release of GEE-TED now uses only MCD12Q1 Version 006; however, alternative LULC data selections can be used with minimal modification to the code. 
&lt;pre&gt;
// Input options
var tempMin = 10 // Temperature thresholds in degrees Celsius 
var tempMax = 40
var ndviMin = 0.39 // NDVI thresholds; proxy for available moisture/humidity
var ndviMax = 1
var movement = 500 // Fly movement rate in meters/16-days

var startYear = 2008 // The first 2 years will be used for model initialization
var endYear = 2019 // Computed probability is based on startYear+2 to endYear

var country = 'KE' // Country codes - https://en.wikipedia.org/wiki/List_of_FIPS_country_codes
var crs = 'EPSG:32737' // See https://epsg.io/ for appropriate country UTM zone
var rescale = 250 // Output spatial resolution

var labelSuffix = '02052020' // For file export labeling only

 //[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17] MODIS/006/MCD12Q1
var lulcOptions006 = [1,1,1,1,1,1,1,1,1, 0, 1, 0, 0, 0, 0, 0, 0] // 1 = suitable 0 = unsuitable

// No more input required ------------------------------ //

var region = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017")
 .filterMetadata('country_co', 'equals', country)

// Input parameter modifications
var tempMinMod = (tempMin+273.15)/0.02
var tempMaxMod = (tempMax+273.15)/0.02
var ndviMinMod = ndviMin*10000
var ndviMaxMod = ndviMax*10000
var ndviResolution = 250
var movementRate = movement+(ndviResolution/2)

// Loading image collections
var lst = ee.ImageCollection('MODIS/006/MOD11A2').select('LST_Day_1km', 'LST_Night_1km')
 .filter(ee.Filter.calendarRange(startYear,endYear,'year')) 
var ndvi = ee.ImageCollection('MODIS/006/MOD13Q1').select('NDVI')
 .filter(ee.Filter.calendarRange(startYear,endYear,'year'))
var lulc006 = ee.ImageCollection('MODIS/006/MCD12Q1').select('LC_Type1')
 
// Lulc mode and boolean reclassification
var lulcMask = lulc006.mode().remap([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],lulcOptions006)
 .eq(1).rename('remapped').clip(region)

// Merge NDVI and LST image collections
var combined = ndvi.combine(lst, true)
var combinedList = combined.toList(10000)

// Boolean reclassifications (suitable/unsuitable) for day/night temperatures and ndvi
var con = function(image) {
 var ndviExp = image.expression("(b('NDVI') &gt; "+ndviMaxMod+") ? 0" + 
 ":(b('NDVI') &gt; "+ndviMinMod+") ? 1" +
 ":(b('NDVI') &lt; "+ndviMinMod+") ? 0" +
 ":1").rename('ndvi_suit')
 var lstDayExp = image.expression("(b('LST_Day_1km') &gt; "+tempMaxMod+") ? 0" + 
 ":(b('LST_Day_1km') &gt; "+tempMinMod+") ? 1" +
 ":(b('LST_Day_1km') &lt; "+tempMinMod+") ? 0" +
 ":1").rename('day_suit')
 var lstNightExp = image.expression("(b('LST_Night_1km') &gt; "+tempMaxMod+") ? 0" + 
 ":(b('LST_Night_1km') &gt; "+tempMinMod+") ? 1" +
 ":(b('LST_Night_1km') &lt; "+tempMinMod+") ? 0" +
 ":1").rename('night_suit')
 
 var add = image.addBands(ndviExp).addBands(lstDayExp).addBands(lstNightExp)
 var multiply = add.select('ndvi_suit').multiply(add.select('day_suit')).multiply(add.select('night_suit'))
 return add.addBands(multiply.rename('suit')).select('suit')
}

var conList = combined.map(con).toList(10000)
var finish = conList.size().subtract(1).getInfo()

// Fly movement rate model
var iterateList = conList
var kernel = ee.Kernel.square({radius: movementRate, units: 'meters'})
var fill = ee.Image(conList.get(0)).multiply(0)
var expansion = fill.add(1)
for (var range = 0; range &lt;= finish; range = range + 1) {
 var img = ee.Image(iterateList.get(range)).select('suit').gt(0).clip(region)
 var multi = img.multiply(expansion).set('num',range)
 var mask = multi.eq(1)
 var masked = multi.updateMask(mask)
 var expand = masked.focal_max({kernel: kernel})
 var expansion = fill.where(expand,1)
 var updateList = iterateList.add(multi)
 var iterateList = updateList
}

// Filter out first two years and compute tsetse probability
var filtered = ee.ImageCollection(updateList).sort('num',false).limit(updateList.size().divide(2).subtract(46))
var filteredProb = filtered.sum().divide(filtered.size()).multiply(100).updateMask(lulcMask)
var probMask = filteredProb.neq(0)
var filteredProbMasked = filteredProb.updateMask(probMask).rename('probability')

var startMod = startYear+2
var naming = 'GEE-TED_'+country+'-'+startMod+'-'+endYear+'_'+labelSuffix

Map.addLayer(lulcMask, {min:0, max:1}, 'MCD12Q1 LULC mask', false)
Map.addLayer(filteredProbMasked, {palette: ['FCFAE1','F6E497','BD8D46','B9121B','4C1B1B'], opacity: 0.8, min: 0, max: 100}, naming, false)
Map.setOptions('HYBRID')
Map.centerObject(region)

// Export image to drive
Export.image.toDrive({
 image: filteredProbMasked,
 description: naming,
 fileNamePrefix: naming,
 maxPixels: 1e13,
 scale: rescale,
 crs: crs,
 region: region
})
&lt;/pre&gt;
&lt;br&gt;
&lt;b&gt;References&lt;/b&gt;
&lt;br&gt;
• DeVisser, M.H. and Messina, J.P., 2009. Optimum land cover products for use in a Glossina-morsitans habitat model of Kenya. &lt;i&gt;International Journal of Health Geographics&lt;/i&gt;, 8(1), pp.1-20.
&lt;br&gt;
• DeVisser, M.H., Messina, J.P., Moore, N.J., Lusch, D.P. and Maitima, J., 2010. A dynamic species distribution model of Glossina subgenus Morsitans: The identification of tsetse reservoirs and refugia. &lt;i&gt;Ecosphere&lt;/i&gt;, 1(1), pp.1-21.
&lt;br&gt;
• Gorelick, N., Hancher, M., Dixon, M., Ilyushchenko, S., Thau, D. and Moore, R., 2017. Google Earth Engine: Planetary-scale geospatial analysis for everyone. &lt;i&gt;Remote Sensing of Environment&lt;/i&gt;, 202, pp.18-27.
&lt;br&gt;
• Lin, S., DeVisser, M.H. and Messina, J.P., 2015. An agent-based model to simulate tsetse fly distribution and control techniques: a case study in Nguruman, Kenya. &lt;i&gt;Ecological Modelling&lt;/i&gt;, 314, pp.80-89.
&lt;br&gt;
• Yang, A., Messina, J.P., Grady, S.C. and White, R.A., 2017. Cost–Benefit Analysis of Tsetse Fly Control in Tanzania. &lt;i&gt;Papers in Applied Geography&lt;/i&gt;, 3(2), pp.182-195.