python and spatial modeling
TRANSCRIPT
Motti Zohar
Department of Geography and Environmentla Studies
University of Haifa
Python and spatial Modeling
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
Lesson 2: Model builder
and Python
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
3
Contents
o Why using modeling?
o What is Model Builder?
o Modeling using ArcGIS Desktop >> export to Pyhton
o Modeling using ArcGIS Pro
o Prior to basic scripting – models may assist in the
understanding of the world of python scripts
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
4
Why using modeling?
o Efficiency
o Distribute and share knowledge and functionalities
o Organization & order
o Process design and Diagram workflows
o Re-use of code
o Structure the GIS analyses
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
5
Benefits
o Models provide an easy way to interpret visual
representation of the data and workflow
o Models can be reused and shared, and are easy to
modify if necessary
o Models are much more convenient than running
many tools individually
o Models can be useful in project documentation
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
6
Model Builder
o Models are a series of geoprocessing tools that
facilitate the automation of complex or repetitive
tasks
o Model Builder is a graphical interface that allows
users to easily create models using existing tools and
data
o Requires no programming experience
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
7
Model builder
A canvas for modeling in which any tool, script or data
can be included in the model by dragging and dropping
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
8
Modulating a process
Process 1
Process 2
Process 3
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
9
Model builder and Python
o Efficient way to start making workflows
o Differences between ArcGIS Desktop and ArcGIS Pro
o Importing and exporting code
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
10
Model builder framework
Tools
Python Window
Search
ModelBuilder
Scripts
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
11
What is a Model Builder process?
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
12
Model builder toolbar – ArcGIS Pro
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
13
Model builder – ArcGIS Desktop
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
14
Demonstration
The problem:
The city planers are interested to map all buildings that
are completely within the city center and are also
within a distance of 100 meters from streets with a
width of 20 meters.
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
15
Iterations, utility and logical
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
16
The importance of using variable & parameters
o Any information used by a tool is a parameter
o Parameters can be hardcoded or set so a user can
enter values
o For example, it is often a good idea to set tool inputs
as parameters to make models more flexible
o It is also useful to make variables for some tool
inputs and expose them as parameters for user input
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
17
Model Builder usage & tips
o Set default geodatabase!
o Input (vector, raster, tables etc.)
o Parameters variables
o Environmental variables
o Save the model - create a toolbox
o Re-use of the model (modify, add, remove)
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
18
Links of how to use Model Builder
1. https://www.esri.com/videos/watch?videoid=1817&isLegacy=true
2. https://pro.arcgis.com/en/pro-
app/help/analysis/geoprocessing/modelbuilder/modelbuilder-
tutorial.htm
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa
19
EXERCISE 2
Python and spatial modeling. The department of Geography and Environmental Studies, University of Haifa