### Sidebar

spatial-ecology.org

Trainings:

Learn:

Data:

Community:
teachers
students
projects
Matera 2015
Vancouver 2015
Santa Barbara 2015
Site design
Hands on:
Installations

Donations
Spatial Ecology is a non profit organisation based in the UK. About us. Please help us in our activity
USD

GBP

wiki:exercise2b

# Exercise 2b: Landsat spectra of golf courses

In this exercise the following tools will be used:

• pktools: pkextract, pkstatogr
• bash: for loop, redirection (> and »)
• gdal/ogr tools: ogr2ogr

This exercise is similar to exercise 2a and shows the difference in phenology between forest and a golf course
Extract golf course and reproject to EPSG:3035 (ETRS89/LAEA)

`ogr2ogr -t_srs epsg:3035 -where 'NAME like "Golf course:%"' \${OUTPUTDIR}/exercise2/cornwall_golf_3035.shp \${VECTORDIR}/cornwall_poi.shp`

Extract Landsat spectra from golf courses in Cornwall (mean value for each polygon)

`pkextract -i \${LANDSATDIR}/\${LANDSATIMG} -s \${OUTPUTDIR}/exercise2/cornwall_golf_3035.shp -o \${OUTPUTDIR}/exercise2/golf_landsat.shp`

Calculate statistics using pkstatogr

`pkstatogr -i \${OUTPUTDIR}/exercise2/golf_landsat.shp -n B0 -n B1 -n B2 -n B3 -n B4 -n B5 -n B6 -n B7 -mean -stdev| awk '{print \$4,\$6}' > \${OUTPUTDIR}/exercise2/golf_landsat_mean_stdev.txt`

Plot the profiles in gnuplot (click here for the code)

wiki/exercise2b.txt · Last modified: 2017/12/05 22:53 (external edit)