General information#

Last updated: 2023-05-27 16:40:42

Course details#

  • Course number: 128.1.0162

  • Time: Sunday 16:10-19:00

  • Place: Building 35, room 403 Building 72, room 249

  • Instructor: Michael Dorman (

  • Grading:

  • Requirements:

    • Basic knowledge of GIS (e.g., “Intro to GIS” course)

    • Self study

  • Getting help:

Lecture plan#

The course lecture plan is given in Table 26.

Table 26 Course lecture plan#





Preface, Setting up the environment



Python basics



Conditionals and loops



Arrays (numpy)



Tables (pandas)



Table reshaping and joins



Geometries (shapely)



Vector layers (geopandas)



Geometric operations



Rasters (rasterio)



Raster-vector interactions



ArcGIS Pro scripting (arcpy)




Home assignments#


  • Assignments should be prepared and submitted individually (not in pairs, etc.)

  • The solution needs to be submitted on Moodle, as a Jupyter notebook (i.e., a single .ipynb file).

  • Specify the following details at the top of the notebook: assignment number, student name, student ID (Fig. 39).

  • Use headings (e.g., ## Question 1 and ## Question 2 in markdown cells) to mark the solution to question 1 and question 2 (Fig. 39).

  • The notebook needs to run without errors, and produce (print) the required outputs, assuming the person who runs the notebook:

    • Has all packages used in the book installed (see Python packages).

    • Runs the notebook from within a directory that contains the data and output sub-directories, with the course sample data and output files (see Sample data).

  • Avoid exporting any files in your code!

  • Make sure your solution is as general as possible. Namely, do not use indices or specific values in your solution, other than the values given in the question text. For example, if the question is “find the largest value in the list x=[4,7,9,2,8,5], the solution x[2] is wrong, because it uses the specific value 2.

  • You can use any function or method in the Python standard library ( to solve the exercises, even if it is not in the material. However, you can only use third-party Python packages which are covered in the material (see What are we going to learn?); you cannot use any other third-party package in your solution.

  • When the solution requires importing one of the sample data files (see Sample data), use a relative path starting with "data", as in "data/carmel.csv". In other words, assume that the notebook is going to be executed in a a directory which contains a sub-directory named data with all sample data files listed in Table 3.


Fig. 39 Structure of .ipynb file for a submitted assignment#

Submission dates#

The sumbission dates of home assignments are given in Table 27.

Table 27 Assignment submission dates#




Home assignment 1

Python basics + Conditionals and loops


Home assignment 2

Arrays (numpy) + Tables (pandas)


Home assignment 3

Table reshaping and joins + Geometries (shapely)


Home assignment 4

Vector layers (geopandas) + Geometric operations


Home assignment 5

Rasters (rasterio) + Raster-vector interactions


Working with the virtual image#

Step 1: Start the virtual image#

  • Go to

  • Click “Next”

  • Type your BGU username and password

  • Click on the “Geography” icon

  • Click “Launch”

  • Click on “Open Horizon Client”

  • Select “Open with VMware Horizon Client” if asked

Step 2: Download sample data#

  • From the desktop, open the link named “Spatial Data Programming with Python”, and download the sample data (see Sample data) (Fig. 40)


Fig. 40 Downloading sample data#

  • Again from the desktop, go to “This PC”, then to “Downloads”

  • You should see the file named data which you downloaded

  • Right-click on data, then click Extract to "data\" (Fig. 41)


Fig. 41 Extracting to data sub-directory#

Step 3: Create output directory#

  • Create a directory named output (for exported files)

Step 4: Download the notebook(s)#

  • Download any of the notebook files of the course (Fig. 17) you wish to work with

  • If you intend to work on a new blank notebook, then you will be able to create one from within the Jupyter notebook interface (see next step)

Step 5: Start the Jupyter Notebook interface#

  • From the desktop, click on “Anaconda Prompt (Miniconda)”

  • In the command line, type juputer notebook and press Enter

  • If asked, choose to open the application with the Edge Browser and click OK

  • You should now be able to work in the Jupyter Notebook interface, in an environment where all packages we learn about are installed and sample data are accessible in the data sub-directory (Fig. 42)


Fig. 42 The Jupyter Notebook interface#

  • When done, close the browser, terminate the Jupyter Notebook application (by pressing Ctrl+C), then log off from the virtual image (by clicking “Start”→Your user→”Sign Out”) (Fig. 43)

  • Important!!! When logging off the virtual environment, the contents of “Downloads”, including the files you have been working with, are deleted! Make sure you copy them to a USB device, e-mail to yourself, etc., before shutting down.


Fig. 43 Signing out of the virtual image#