User Tools

Site Tools


wiki:gdaladvance

Advance GDAL and OGR script

Gdal and OGR combined with awk and other bash commands can be used to create your own geotools.

Build up your geo-tools

Exercise:
Script: open by kate but do not modify ~/ost4sem/exercise/basic_adv_gdalogr/tif2ascUL.sh
Data: ~/ost4sem/exercise/basic_adv_gdalogr/input.tif
Directory: ~/ost4sem/exercise/basicadvgdalogr

Read the explanation carefully and try to understand the script, returning to the following questions:
1. line
Which is the format indicated by “-of AAIGrid”? What is its typical structure?
What indicates the $1 symbol?
Run only the first line using input.tif and open the gridasc.asc using more.
What is this file?
2. line
Explain the awk syntax. If you do not know, search on the Internet.
Run it. Open the file output. <code bash> cd ~/ost4sem/exercise/basic
adv_gdalogr sh tif2ascULND.sh input.tif output.asc </code> Use openev to check whether the pixel values are correct.

A more complicated script is this tif2ascULsmp.sh
Open it, study it and run! Enjoy!

Exercise: Using the catted images of your country run a tif2ascUL.sh or more complicate tif2ascULsmp.sh for all the images by a loop.

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