{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 05 Interpolating Rasters\n", "\n", "In case the digital elevation model of a simple geological map needs to be interpolated from topographic contours, several methods have been implemented in GemGIS. These include the methods ```nearest```, ```cubic``` and ```linear``` of ```scipy.interpolate.griddata``` and ```Rbf``` of ```scipy.interpolate.rbf```. The different methods can be accessed by passing the argument ```method= 'method_name'```. More information about the interpolation methods can be found [here](https://docs.scipy.org/doc/scipy/reference/interpolate.html).\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Set File Paths and download Tutorial Data\n", "\n", "If you downloaded the latest `GemGIS` version from the Github repository, append the path so that the package can be imported successfully. Otherwise, it is recommended to install `GemGIS` via `pip install gemgis` and import `GemGIS` using `import gemgis as gg`. In addition, the file path to the folder where the data is being stored is set. The tutorial data is downloaded using Pooch (https://www.fatiando.org/pooch/latest/index.html) and stored in the specified folder. Use `pip install pooch` if Pooch is not installed on your system yet." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2021-03-17T11:02:16.442352Z", "start_time": "2021-03-17T11:02:14.173675Z" } }, "outputs": [], "source": [ "import gemgis as gg\n", "\n", "file_path ='data/05_interpolating_rasters/'" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2021-03-17T11:02:16.505963Z", "start_time": "2021-03-17T11:02:16.476379Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Downloading file '05_interpolating_rasters.zip' from 'https://rwth-aachen.sciebo.de/s/AfXRsZywYDbUF34/download?path=%2F05_interpolating_rasters.zip' to 'C:\\Users\\ale93371\\Documents\\gemgis\\docs\\getting_started\\tutorial\\data\\05_interpolating_rasters'.\n" ] } ], "source": [ "gg.download_gemgis_data.download_tutorial_data(filename=\"05_interpolating_rasters.zip\", dirpath=file_path)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Loading Data" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2020-12-28T09:29:36.448694Z", "start_time": "2020-12-28T09:29:31.253247Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " | id | \n", "Z | \n", "geometry | \n", "
---|---|---|---|
0 | \n", "None | \n", "400 | \n", "LINESTRING (0.74088 475.44101, 35.62873 429.24... | \n", "
1 | \n", "None | \n", "300 | \n", "LINESTRING (645.96500 0.52496, 685.14093 61.86... | \n", "
2 | \n", "None | \n", "400 | \n", "LINESTRING (490.29223 0.52496, 505.75641 40.73... | \n", "
3 | \n", "None | \n", "600 | \n", "LINESTRING (911.43347 1068.58451, 908.85610 10... | \n", "
4 | \n", "None | \n", "700 | \n", "LINESTRING (228.43207 1068.58451, 239.77247 10... | \n", "