# 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 (dorman@post.bgu.ac.il)

• 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#

Lesson

Topic

Date

01

2022-03-20

02

Python basics

2022-03-27

03

Conditionals and loops

2022-04-03

04

Arrays (numpy)

2022-04-10

05

Tables (pandas)

2022-04-24

06

Table reshaping and joins

2022-05-01

07

Geometries (shapely)

2022-05-08

08

Vector layers (geopandas)

2022-05-15

09

Geometric operations

2022-05-22

10

Rasters (rasterio)

2022-05-29

11

Raster-vector interactions

2022-06-12

12

ArcGIS Pro scripting (arcpy)

2022-06-19

13

2022-06-26

## Home assignments#

### Instructions#

• 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 (https://docs.python.org/3/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.

### Submission dates#

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

Table 27 Assignment submission dates#

Assignment

Topic(s)

Date

Home assignment 1

2022-05-01

Home assignment 2

2022-05-15

Home assignment 3

2022-05-29

Home assignment 4

2022-06-12

Home assignment 5

2022-06-26

## Working with the virtual image#

### Step 1: Start the virtual image#

• Click “Next”

• Click on the “Geography” icon

• Click “Launch”

• Click on “Open Horizon Client”

• Select “Open with VMware Horizon Client” if asked

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

• 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)

### Step 3: Create output directory#

• Create a directory named output (for exported files)

• 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)

• 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.