User Tools

Site Tools


wiki:gdalpktools_kenya

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:gdalpktools_kenya [2020/05/11 07:07]
new_ost4sem_admin [In the Ubuntu VM]
wiki:gdalpktools_kenya [2021/01/20 20:36] (current)
Line 1: Line 1:
 ====== Use GDAL/OGR and PKTOOLS for raster/​vector operations ====== ====== Use GDAL/OGR and PKTOOLS for raster/​vector operations ======
  
-==== Enter in the AWS Ubuntu Machine  ​====+==== Enreach OSGeoLive Linux Virtual with PKTOOLS and Openev ​  ====
 \\ \\
- +If you download ​the OSGeoLive 13 directly from [[https://live.osgeo.org/en/index.html]] then you have to install pktools ​and openev following this procedure ​[[ pkt_openev_osgeolive | Install pktools, openev and R 4.0.2 in OSGeoLive 13 Linux Virtual]]  \\
-On **Linux or Mac**: +
-   +
-  wget -N http://​www.spatial-ecology.net/​ost4sem/​exercise/​id_rsa_class ​ -O id_rsa_class +
-  # Mac user can use this +
-  # curl -o id_rsa_class ​  ​http://​www.spatial-ecology.net/​ost4sem/​exercise/​id_rsa_class +
-  chmod 600 id_rsa_class +
-  # login using the ssh. Change user???? in accordance to your user ID  +
-  ssh -i  id_rsa_class -X -Y user??​@52.138.103.28  +
- +
- +
-On **Windows**:​\\ +
- +
-Download ​[[ https://www.puttygen.com| PuTTYgen ​]] - copy the key in a text file and save as id_rsa_class - and import the [[  ​http://​www.spatial-ecology.net/​ost4sem/​exercise/​id_rsa_class | id_rsa_class ​]] file.\\ +
-Use [[ https://​putty.org | PuTTY ]]  to ssh to uuser??​@52.138.103.28. +
 ==== In the Ubuntu VM ==== ==== In the Ubuntu VM ====
 Data Directory: $HOME/​ost4sem/​exercise/​geodata\_SDM/​ \\ Data Directory: $HOME/​ost4sem/​exercise/​geodata\_SDM/​ \\
  
   ##### Download the data ONLY if your following the exercise in your machine. ​   ##### Download the data ONLY if your following the exercise in your machine. ​
-  ##### I you are using the Linux Virtuan Machine you do not need to dowload the data. +  ##### I you are using the OSGeoLive 13.0 Linux Virtuan Machine you do not need to dowload the data. 
   mkdir -p $HOME/​ost4sem/​exercise   mkdir -p $HOME/​ost4sem/​exercise
   cd $HOME/​ost4sem/​exercise   cd $HOME/​ost4sem/​exercise
Line 30: Line 15:
   cd $HOME/​ost4sem/​exercise/​geodata_SDM   cd $HOME/​ost4sem/​exercise/​geodata_SDM
   wget -N http://​spatial-ecology.net/​ost4sem/​exercise/​geodata_SDM/​gdal-ogr-pktools.sh   wget -N http://​spatial-ecology.net/​ost4sem/​exercise/​geodata_SDM/​gdal-ogr-pktools.sh
 +  emacs -nw  $HOME/​ost4sem/​exercise/​geodata_SDM/​gdal-ogr-pktools.sh
   ## gedit $HOME/​ost4sem/​exercise/​geodata_SDM/​gdal-ogr-pktools.sh &   ## gedit $HOME/​ost4sem/​exercise/​geodata_SDM/​gdal-ogr-pktools.sh &
 +  ## rstudio $HOME/​ost4sem/​exercise/​geodata_SDM/​gdal-ogr-pktools.sh &
  
 ===== GDAL Commands ===== ===== GDAL Commands =====
Line 43: Line 30:
 # Visualize the image # Visualize the image
  
-qgis vegetation/​ETmean08-11.tif 
 openev vegetation/​ETmean08-11.tif openev vegetation/​ETmean08-11.tif
 </​code>​ </​code>​
Line 276: Line 262:
 pkcomposite $(for file in LST/​LST_MOYDmax_month??​.tif LST/​LST_MOYDmax_month?​.tif ​ ; do echo -i $file ;  done ) -m LST/​LST_MOYDmax_month1-msk.tif -msknodata 0 -cr stdev   ​-dstnodata -1 -co  COMPRESS=LZW -co ZLEVEL=9 -o LST/​LST_MOYDmax_monthStdev.tif pkcomposite $(for file in LST/​LST_MOYDmax_month??​.tif LST/​LST_MOYDmax_month?​.tif ​ ; do echo -i $file ;  done ) -m LST/​LST_MOYDmax_month1-msk.tif -msknodata 0 -cr stdev   ​-dstnodata -1 -co  COMPRESS=LZW -co ZLEVEL=9 -o LST/​LST_MOYDmax_monthStdev.tif
 </​code>​ </​code>​
 +Pkcomposite is very flexible, it can deal with different extents, resolutions,​ and can be used in combination with gdal comand to make composite of modis immages (see [[ wiki:​modiswget | Download MODIS Land Surface Temperature (*.hdf) from Nasa ftp ]])
  
-an alternative way is to use pkstatprofile+An alternative way is to use pkstatprofile
  
 <code bash> <code bash>
Line 333: Line 320:
 pkextractogr -f CSV -buf 2 -srcnodata -339999995214436424907732413799364296704 -r mean -r stdev -r min -i vegetation/​GPPmean08-11.tif -s shp/​presence.shp -o shp/​point-buf_stat.csv pkextractogr -f CSV -buf 2 -srcnodata -339999995214436424907732413799364296704 -r mean -r stdev -r min -i vegetation/​GPPmean08-11.tif -s shp/​presence.shp -o shp/​point-buf_stat.csv
 </​code>​ </​code>​
 +
 +Remove all the output
  
 <code bash> <code bash>
wiki/gdalpktools_kenya.1589195265.txt.gz · Last modified: 2021/01/20 20:36 (external edit)