From 772cd8d603a5e17787fad95b0e6e55f36511d1a4 Mon Sep 17 00:00:00 2001 From: krishnaglodha Date: Thu, 22 Jun 2023 09:23:52 +0530 Subject: [PATCH 1/2] added code to load vector data on raster --- .../content/notebooks/04-vector-data.ipynb | 4 ++-- .../content/notebooks/05-raster-data.ipynb | 22 ++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/workshop/jupyter/content/notebooks/04-vector-data.ipynb b/workshop/jupyter/content/notebooks/04-vector-data.ipynb index aac8a0a..04f25ce 100644 --- a/workshop/jupyter/content/notebooks/04-vector-data.ipynb +++ b/workshop/jupyter/content/notebooks/04-vector-data.ipynb @@ -1768,7 +1768,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" }, "vscode": { "interpreter": { @@ -1778,4 +1778,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} diff --git a/workshop/jupyter/content/notebooks/05-raster-data.ipynb b/workshop/jupyter/content/notebooks/05-raster-data.ipynb index c687781..4f2d90a 100644 --- a/workshop/jupyter/content/notebooks/05-raster-data.ipynb +++ b/workshop/jupyter/content/notebooks/05-raster-data.ipynb @@ -229,6 +229,26 @@ "plot.show(world)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also diplay vector data on top of raster data quickly with few lines" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import geopandas as gpd\n", + "places = gpd.read_file('../data/populated_places.gpkg')\n", + "fig, ax = pyplot.subplots(figsize=(15, 15))\n", + "plot.show(world, ax=ax, transform=world.transform);\n", + "places.plot(ax=ax, facecolor='none', edgecolor='r');" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -523,7 +543,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.11.4" } }, "nbformat": 4, From 9eb7b28bfdde58d3b0e0aadf202d785663764e13 Mon Sep 17 00:00:00 2001 From: krishnaglodha Date: Fri, 23 Jun 2023 13:13:58 +0530 Subject: [PATCH 2/2] moved position of code and imported pyplot --- .../content/notebooks/05-raster-data.ipynb | 68 +++++++++++++------ 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/workshop/jupyter/content/notebooks/05-raster-data.ipynb b/workshop/jupyter/content/notebooks/05-raster-data.ipynb index 1d13c42..dc1aa02 100644 --- a/workshop/jupyter/content/notebooks/05-raster-data.ipynb +++ b/workshop/jupyter/content/notebooks/05-raster-data.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -8,6 +9,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -39,6 +41,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -50,6 +53,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -78,6 +82,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -105,6 +110,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -148,6 +154,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -164,6 +171,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -180,6 +188,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -205,6 +214,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -212,6 +222,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -230,26 +241,7 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can also diplay vector data on top of raster data quickly with few lines" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import geopandas as gpd\n", - "places = gpd.read_file('../data/populated_places.gpkg')\n", - "fig, ax = pyplot.subplots(figsize=(15, 15))\n", - "plot.show(world, ax=ax, transform=world.transform);\n", - "places.plot(ax=ax, facecolor='none', edgecolor='r');" - ] - }, - { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -266,6 +258,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -287,6 +280,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -304,6 +298,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -323,6 +318,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -344,6 +340,29 @@ ] }, { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also diplay vector data on top of raster data quickly with few lines" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from matplotlib import pyplot \n", + "import geopandas as gpd\n", + "places = gpd.read_file('../data/populated_places.gpkg')\n", + "fig, ax = pyplot.subplots(figsize=(15, 15))\n", + "plot.show(world, ax=ax, transform=world.transform);\n", + "places.plot(ax=ax, facecolor='none', edgecolor='r');" + ] + }, + { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -351,6 +370,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -367,6 +387,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -385,6 +406,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -403,6 +425,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -434,6 +457,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -451,6 +475,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -479,6 +504,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -497,6 +523,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -515,6 +542,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [