|
873 | 873 | <div class="contents col-xs-12 col-md-10"> |
874 | 874 | <h1 id="wur-geoscripting"><a href="https://geoscripting-wur.github.io/">WUR Geoscripting</a> <img src="https://www.wur.nl/upload/854757ab-168f-46d7-b415-f8b501eebaa5_WUR_RGB_standard_2021-site.svg" alt="WUR logo" style="height: 35px;"/></h1> |
875 | 875 | <h1 id="week-3-lesson-10-handling-raster-data-with-python">Week 3, Lesson 10: Handling Raster data with Python</h1> |
876 | | -<p><em>Jan Verbesselt, Jorge Mendes de Jesus, Aldo Bergsma, Dainius Masiliūnas, David Swinkels, Judith Verstegen, Corné Vreugdenhil</em> - 2022-01-09</p> |
| 876 | +<p><em>Jan Verbesselt, Jorge Mendes de Jesus, Aldo Bergsma, Dainius Masiliūnas, David Swinkels, Judith Verstegen, Corné Vreugdenhil</em> - 2022-01-17</p> |
877 | 877 | <h2 id="introduction">Introduction</h2> |
878 | 878 | <p>Today we will work with Python packages for spatial raster analysis. Python has some dedicated packages to handle rasters:</p> |
879 | 879 | <ul> |
@@ -902,22 +902,24 @@ <h2 id="setting-up-the-python-environment">Setting up the Python Environment</h2 |
902 | 902 | mkdir data |
903 | 903 | mkdir output</code></pre> |
904 | 904 | </div> |
905 | | -<p>Next, create a text file, (re)name it (to) <code>raster.yaml</code>, and copy the following content into the file:</p> |
| 905 | +<p>Like in the previous lesson, we will create a conda environment with one <code>.yaml</code> file, and then update it with a second <code>.yaml</code> file. Use the following content for the two files:</p> |
906 | 906 | <pre><code>name: raster |
907 | | -channels: |
908 | | - - conda-forge |
909 | 907 | dependencies: |
910 | 908 | - python |
911 | 909 | - numpy |
912 | 910 | - matplotlib |
913 | 911 | - spyder |
914 | 912 | - owslib |
915 | 913 | - gdal |
| 914 | + - geopandas</code></pre> |
| 915 | +<pre><code>name: raster |
| 916 | +channels: |
| 917 | + - conda-forge |
| 918 | +dependencies: |
916 | 919 | - rasterio |
917 | | - - geopandas |
918 | 920 | - rasterstats |
919 | 921 | - affine</code></pre> |
920 | | -<p>Use this file to create an environment for this tutorial, as you have learned in the refresher lesson. NOTE: This can take a while (5-10 minutes); just go and get a coffee/tea/water/juice. Activate the environment, open Spyder, create a script in the root folder and start coding.</p> |
| 922 | +<p>Use these two files to create an environment for this tutorial. NOTE: The second one can take a while (5-10 minutes); just go and get a coffee/tea/water/juice. Finally, activate the environment, open Spyder, create a script in the root folder and start coding.</p> |
921 | 923 | <h2 id="reading-raster-data-and-accessing-metadata">Reading raster data and accessing metadata</h2> |
922 | 924 | <h3 id="via-a-web-coverage-service">Via a Web Coverage Service</h3> |
923 | 925 | <p>A Web Coverage Service (WCS) loads raster data in a similar way as Web Feature Services (WFS) load vector data. <a href="https://www.opengeospatial.org/standards/wcs">Web Coverage Services</a> are a standard by the Open Geospatial Consortium and allow the downloading of geospatial raster data with multiple types of format encoding: GeoTIFF, netCDF, JPEG2000 etc. A <a href="https://www.opengeospatial.org/standards/wms">Web Map Service</a> [WMS] also exists for rasters; it allows downloading of images but without the data values.</p> |
|
0 commit comments