NRM638 Python Scripting for GIS

I will teach this as an eLearning graduate class spring semester 2015

(The following are youtube sessions from the previous time I taugh the course..spring 2012)

 

 

 


Objectives:


Instructor:

Dave Verbyla, Professor,
Dept. of Forest Sciences, ONeill Bldg 368
Email: dlverbyla@alaska.edu
Office Hours: Tuesdays, Thursdays 8:30-9:30am, or email appointment


Grading will be based as follows:


13 Weekly programming assignments @ 20 points each,

final student presentation @40 points

270-300 points = A (>90%)

240-270 points = B ( 80 - 90 %)

210-270 points = C ( 70 - 80%)

180-210 points = D (60 - 70 %)

< 180 points = F (< 60 %)

All assignments are due by Friday noon, emailed to: dlverbyla@alaska.edu

The final student presentation will be a Python script, ArcGIS script tool, or geoprocessing script that you have created.



Readings

Weekly Youtube video sessions

You need to complete each script assignment at the end of each youtube lesson. Then you will be ready to work on the weekly assignments that are posted at this website.


Disability Services: 


I will work  with the Office of Disabilities Services (203 WHIT, 474-7043)  to provide reasonable accommodation to to any student with a disability.

Please inform me the first week of class if you have a disability that we should be aware of.


 

Topic

Scripting Assignment

Before Jan 28, 2013  :

Week 1: Introduction to Python Scripting

1) Week1 Preview

2) Basic Python scripting

3 ) Python Variables

4) Python Lists

5) Python Loops

6) Python Modules

7) Python OS Module


Python scripts to rename files, create folders, check for companion projection file for every shapefile

Before Feb 4, 2013  :

Working with Point, Line, Polygon Shapefiles:

1) Week 2 Preview

2) Creating test shapefiles

3 ) Getting layer information

4) Python decisions/ geometry types

5) Getting field names and types

6) Point layer information

7) Polyline layer information

8) Polygon information

Layer Information Summary pdf


Python scripts to report GIS Layer Information

 

Before Feb 11, 2013  

Week 3 :Creating GIS point, line, polygon shapefile

1) Preview

2) Reading data files

3) Writing to log files

4) Creating point shapefiles

5) Creating line shapefiles

6) Creating polygon shapefiles


Summary pdf working with textfiles, creating shapefiles


Python scripts to create point, line, and polygon shapefiles

 

Before Feb 18, 2013  

Week 4: Creating random locations and random selections

1) Preview Week4: Python Random Module

2) Random distributions

3) Random selections and shuffles

4) Selecting feature operators

5) Making selection sets







Python scripts working with a transect line or parcel polygons

Sample Scripts:

Midpoint on transect line

Ten uniform points on transect line

Ten random points on transect line

Print out parcel fields definitions

Randomly select 100 parcels

Randomly select 100 parcels from parcels with land value exceeding $20,000

Before Feb 25, 2013

Week 5: Python OGR Geoprocessing Overlay, Distance, and Filtering

1) Week 5 Preview: Basic Python OGR Geoprocessing Operations

2) Buffering features

3) Distance to features

4) Selecting feature within a threshold distance

5) Overlay operations (intersect, erase, etc.)

 

Python scripts to solve distance, adjacency, clipping or containment problems

Sample Scripts:

Mean Distance to Closest Willow For All Animal Locations

Wildfires Inside Refuge Boundary

Mean Land Value of Parcels Adjacent to Chena River

Lightning Strike Density Inside Each EcoRegion Polygon

Before March 4, 2013

Week 6: OGR Python Geoprocessing Problems

1) Preview: Four more geoprocessing problems

2) Flipping stream lines so all streams flow downstream

3) Reporting salmon counts by species for each stream name

4) Computing percent permafrost within each watershed basin polygon

5) Computing distance between radiocollared animal locations



Python scripts to solve flip line direction,feature count near another layer's feature, percent within polygons, and distance betwee locations problems

Sample Scripts:

Flip stream lines

Percent Permafrost in Watershed Basins

Salmon Counts By Stream and Species

Animal Points Distance and Speed of Travel

 

SPRING BREAK

SPRING BREAK

 

 

 

Before March 18, 2013  

Week 7: Arc GIS Field Calculator scripting

1) Preview: Arcmap Python Field Calculator

2) Python Field Calculation Basics

3) Field Calculation: Checks For String Fields

4) Field Calculations: Changing String Values

5) Python Date/Time Functions

6) Retrieving Point, Line, Polygon Shape Properties

 

ArcGIS Field Calculator: Python scripting applications

 

Before March 25, 2013  

Week 8: Arcpy geoprocessing

1) Arcpy Geoprocessing to Solve Spatial Problems

2) Arcpy Environment Variables and Geoprocessing Messages

3) Arcpy Listing and Describe Functions

4) Arcpy Mult-Value Parameters for Geoprocessing Tools

 





Arcpy Geoprocessing Python Scripts

Before April 1, 2013

Week 9: Arcpy Data Access Modlue: Cursors

1)Week 9: Preview: Arcpy Data Access to Feature Attribute Tables Including Shape Geometry

2) Insert Cursor for Creating Point, Line or Polygon Features

3) Search Cursor for Fast Queries of Attribute Tables or Access to Feature Geometry

4) Update Cursor for Updating Feature Attributes or Feature Geometry

 


Arcpy Data Access Assignment: Insert Cursor, Search Cursor, Udate Cursor

Sample scripts:

http://nrm.salrm.uaf.edu/~dverbyla/nrm638/labs/arcpy_cursors/

Before April 8, 2013

 Weeks 10-11 ArcGIS script tools

1) ArcGIS Script Tools

2) Introduction to Script Tools

3) Documenting Script Tools

4)More Script Tool Applications

5)Parsing Feature Class Strings

6) Field Objects


7)Boolean Parameter/Spatial Reference

8) Script Tool Progressor


ArcGIS Script Tools

Sample scripts:

http://nrm.salrm.uaf.edu/~dverbyla/nrm638/labs/arcpy_cursors/

 

Before April 15, 2013  


 


ArcGIS Script ToolsII

Sample scripts:

http://nrm.salrm.uaf.edu/~dverbyla/nrm638/labs/script_tools_python/

 

Before April 22, 2013

Week 12: Working With Rasters (arcpy.sa module)

1)Preview: Raster Processing Using Python

2) Extracting Pixel Values Within Points and Polygons

3) Retrieving Raster Properties

4) Processing LIDAR Elevation Rasters

5) Processing Climate Rasters

6) Determining Minimum Cost Paths To Resources

7) Deriving High Flow Accumulation Channels and Stream Order From Elevation Rasters




Script Tools For Raster Applications

Sample scripts:

http://nrm.salrm.uaf.edu/~dverbyla/nrm638/labs/rasters_python/

 

Before April 29, 2011  

 Week 13: arcpy.mapping module

1) Preview arcpy.mapping applications

2) Working with arcpy.mapping mapdoc object

3) Working with data frames

4) Working with layers

5) Arcmap script tools

6) Layout scripting and creating pdf map books





arcpy.mapping script tool and pdf map book applications

Sample scripts:

http://nrm.salrm.uaf.edu/~dverbyla/nrm638/labs/arcpy_mapping/

 

May 6, 2011  

 Week 14: How to create a screencast presentation



 

 


Page last update January 2011
 dlverbyla@alaska.edu