Groundsure

Hello!

These are the joining instructions for the Groundsure Geospatial Python for Beginners – July 23rd 2019.

Pre-Course

I understand and appreciate that everyone has their own unique computer setup. This is something that can cause Python users some problems. It can be confusing.

https://m.xkcd.com/1987/

Because of this I recommend you install Anaconda. However you can use your own setup if you prefer.

Recommended Python Set up

Important please check before course starts

I recommend using Anaconda https://www.anaconda.com/download/ This course is for Python 3, however it ‘should’ work on Python 2.7. At the time of the course there will be less than a year left of Python 2.7 support https://pythonclock.org/

You may need to open the Anaonda Prompt as an Administrator, by doing this it should remove any permission errors. Right click and select Run As Administrator.

If you can type ‘python’ into a the anaconda prompt then you should be good to go

Anaconda comes pre cooked with jupyter notebook

type (you might wish to change directory to the root of D: first – cd d:)

jupter notebook

into the command prompt and it should open up a web browser within your directory of all your folder/files and notebooks.

Make sure you have gdal installed. Close all windows and in a new anaconda command prompt the command is

conda install -c conda-forge gdal

This is a beginners course so at this point you are good to go, we will not be covering any of the libraries below… however I believe it is worth getting these installed as part of a standard Python Geospatial setup. It is entirely up to you.


Optional installs (but useful for further Geospatial work)

opencv install

conda install -c conda-forge opencv=3.3.1

sklearn install

conda install -c anaconda scikit-learn

skimage install

conda install -c anaconda scikit-image

raster stats install

conda install -c conda-forge rasterstats

scipy install

conda install -c anaconda scipy

rasterio install

conda install -c anaconda rasterio

GeoPandas install

conda install -c conda-forge geopandas

Shapely install

conda install -c conda-forge shapely


Check that gdal is installed using the syntax

from osgeo import gdal,ogr

I have written two more detailed blog posts that should be of help if you have any issues

Python for Geospatial work flows part 1: Use anaconda

and

Python for Geospatial work flows part 2: Use Jupyter Notebooks

I will cover Jupyter Notebooks in this course, so you don’t need to read this post.

Further useful software

  1. Notepad ++ https://notepad-plus-plus.org/
  2. OSGeo4W for QGIS https://trac.osgeo.org/osgeo4w/

 

Data

I run the course through a folder on my computer. I suggest you create a folder on your machine

D:\Groundsure

Please download (21mb)

The QGIS Sample Data https://qgis.org/downloads/data/qgis_sample_data.zip

Extract this to

D:\Groundsure\qgis_sample_data

Please download the course data data_package_beg (~17mb)

Extract this to

D:\Groundsure\data_package_beg

Code

I will make the course code¬†available at the start of the morning and afternoon. I would like you to try and follow the examples as we go, but don’t worry about mistakes this is all good practice.

Challenges

Throughout the course as our learning progresses I have created a series of challenges. These are to aid your learning, help you practice. At the end of the challenge I share a solution, I will make these available after the course. We will time permitting discuss other solutions. The aim is to experiment try new things.

Structure – topics covered

We have a large amount of material to cover in one day for 10 attendees this can quickly disappear. Please make sure you have a working Python environment and able to import gdal prior to starting the course.

Morning 10am

*Fundamentals of Python including data types *Advanced lists – Challenge 1 (small) *Operators review – Challenge 2 (small) *Errors – Challenge 3 (workbook)

Break 11:30 – 11:45

*Functions – Challenge 4 *Conditional statement – Challenge 5 *Loops – Challenge 6

Lunch 12:45 – 1:30

*Working with directories – Challenge 7 *Working with textfiles – Challenge 8 *Reading & writing a Shapefile *Reading Raster data

Break 3:00 – 3:15

*Graphing data – Challenge 9 *Command line GDAL *Raster Boundary (making steps to intermediate level) – see example *Fastest image to introduce wider ideas *Shapefile QC report – Challenge 10

end 4pm

*questions / discussions

end 4:30pm

Post course email

Intermediate Python & answers to challenges & helpful links that we discussed on course

 

Please contact me with any questions info@acgeospatial.co.uk