Determining site suitability for oil palm plantation


Proper land suitability assessment for agriculture has to be carried out to determine the potentiality of a land area to provide the most favorable ecological requirements for a particular crop variety, which results in optimum crop development and maximum productivity.

In this notebook, we determine the site suitability for oil palm development by:

  • Creating hosted imagery layers.
  • Applying raster function chain using the RFT class from the arcgis.raster.functions module.
  • Persisting the raster analysis in ArcGIS Online.

Note: This analysis can be conducted on ArcGIS Enterprise as well as on ArcGIS Online. In this notebook, the notebook was carried out using ArcGIS Online.


  • To run raster analysis functions on ArcGIS Online, you must have privileges to create and publish content and to perform Raster Analysis. For more information, refer here.

  • For creating imagery layers using copy_raster in ArcGIS Online, Azure library packages for Python (Azure SDK for Python - azure-storage-blob: 12.1<= version <=12.8) needs to be pre-installed. Refer

  • An optional installation of graphviz 2.38 can be used to visualize the funciton chain of the raster function template.

Necessary Imports

import os
import zipfile

import arcgis
from arcgis.gis import GIS
from import copy_raster
from arcgis.raster.functions import RFT
gis = GIS("Home")

Using Raster Function Template (RFT)

A raster function template is a model that consists of many function chains to produce a processing workflow. We can build the RFT using the function editor and raster functions pane.

The RFT can be created using ArcGIS Pro or ArcGIS Enterprise.

Suitability factors taken into consideration in the RFT

In order to carry out the suitability analysis, we need to consider some of the favorable environmental and crop criteria settings:

Suitability  ConsiderationsSuitableNot suitable
Elevation0-1000m>1000 m
Conservation area buffer>1000 m<1000m
Soil typeInceptisol, Oxisol, Alfisol, Ultisol, Spodosol, EntisolHistosols
Soil acidity1-7None

Based on these criteria, a raster function template was created using ArcGIS Pro. You can acquire the RFT using the following item.

palm_oil_suitability_rft = gis.content.get('9fa702ab04f747be99607206c2d0eaaa')
Raster function template by api_data_owner
Last Modified: June 26, 2021
0 comments, 0 views

The RFT can be further added to your own GIS for further analysis, by downloading the RFT and adding it to your GIS.

# assign variables to locations on the file system 
cwd = os.path.abspath(os.getcwd())
data_path = os.path.join(cwd, r'data')
rft_path =

Uploading the RFT to ArcGIS Online using Content Manager

palm_oil_suitability_rft_item=gis.content.add(item_properties={"type":"Raster function template",

Creating the RFT object using the RFT class from raster function template item.

palm_oil_suitability_rft = RFT(palm_oil_suitability_rft_item, gis=gis)

We can visualize the function chain and help document specific to this RFT in order to understand the input parameters and the functions involved.

palm_oil_suitability_rft.draw_graph(graph_size='10, 15')

A '?' before or after an RFT object will display the help document consisting of the parameters marked as public by the author of the RFT.

A raster function template to determine the site suitability for oil palm development.


ElevRaster : None
SlopeRaster : None
ConsRaster : None
STypeRaster : None
SAcidRaster : None

Imagery Layer, on which the function chain is applied 

Creating hosted imagery layers for analysis

Hosted imagery layers can be used to manage, share, and analyze raster and imagery data. Hosted imagery layers can be used as an input to analysis tools, create custom workflows with raster functions, manage large collections of imagery, and include imagery layers in maps.

The copy_raster function is used here to create hosted imagery layers in ArcGIS Online from local raster datasets.

In the following cells, we will be creating hosted layers representing the elevation, conservation area buffer, slope, soil type and soil acidity. They will act as the input rasters to the RFT.

You can acquire the data for analysis by using the following item.

analysis_data = gis.content.get('40b00dc5c8794059811d0cced66e9113')
Image Collection by api_data_owner
Last Modified: June 26, 2021
0 comments, 0 views
#downloading the data
analysis_data_path =
with zipfile.ZipFile(analysis_data_path, 'r') as zip_ref:
elevation_wm_data_path = os.path.join(os.path.splitext(analysis_data_path)[0], r'elevation_wm')
elevation_wm_item = copy_raster(input_raster=elevation_wm_data_path,
                                raster_type_name="Raster Dataset",
elevation_wm_layer = elevation_wm_item.layers[0]
mp =
mp.extent = {'spatialReference': {'latestWkid': 3857, 'wkid': 102100},
 'xmax': 13940786.084357359,
 'xmin': 11533936.937714368,
 'ymax': 495805.2734337793,
 'ymin': -482588.6886162166}
conser_wm_data_path = os.path.join(os.path.splitext(analysis_data_path)[0], r'conser_wm')
conser_wm_item = copy_raster(input_raster=conser_wm_data_path,
                             raster_type_name="Raster Dataset", 
conser_wm_layer = conser_wm_item.layers[0]
slope_wm_path = os.path.join(os.path.splitext(analysis_data_path)[0], r'slope_wm')
slope_wm_item = copy_raster(input_raster=slope_wm_path,
                            raster_type_name="Raster Dataset",
slope_wm_layer = slope_wm_item.layers[0]
soil_acid_wm_path = os.path.join(os.path.splitext(analysis_data_path)[0], r'soil_acid_wm')
soil_acid_wm_item = copy_raster(input_raster=soil_acid_wm_path,
                                raster_type_name="Raster Dataset",
soil_acid_wm_layer = soil_acid_wm_item.layers[0]
soil_type_wm_path = os.path.join(os.path.splitext(analysis_data_path)[0], r'soil_type_wm')
soil_type_wm_item = copy_raster(input_raster=soil_type_wm_path,
                                raster_type_name="Raster Dataset",
soil_type_wm_layer = soil_type_wm_item.layers[0]

Applying the raster function chain on the input layers to create the suitability raster

suitability_output = palm_oil_suitability_rft(ElevRaster=elevation_wm_layer,
                                              SlopeRaster=slope_wm_layer , 

Persisting the output in the GIS

saved_output ='palm_oil_suitability_saved_til', tiles_only=True)

In the output, the red areas denote places that are less suitable for oil palm plantation, while green areas represent places that are more suitable.


In this notebook, we located potentially suitable areas for sustainable oil palm cultivation. This analysis can act as a first step in a site selection process for a certified sustainable plantation and can inform government officials and nongovernmental organizations (NGOs) in assessing land use policy options to support the expansion of sustainable palm oil production.


[1][ ]

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.