From 82d169c35264b9aefe38bbb8f7cbc75088a5e940 Mon Sep 17 00:00:00 2001 From: Just van den Broecke Date: Mon, 27 Sep 2021 11:52:41 +0200 Subject: [PATCH] #54 localized Visualization to Buenos Aires/South America --- .../content/notebooks/07-visualization.ipynb | 17 ++++---- .../content/notebooks/test/07-folium-1.html | 14 +++---- .../content/notebooks/test/07-folium-2.html | 40 +++++++++---------- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/workshop/jupyter/content/notebooks/07-visualization.ipynb b/workshop/jupyter/content/notebooks/07-visualization.ipynb index fe0c23d..1943436 100644 --- a/workshop/jupyter/content/notebooks/07-visualization.ipynb +++ b/workshop/jupyter/content/notebooks/07-visualization.ipynb @@ -46,14 +46,14 @@ "source": [ "import folium\n", "\n", - "folium_map = folium.Map(location=[44.43225, 26.10626])" + "folium_map = folium.Map(location=[-34.603722, -58.381592])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "To display it in a Jupyter notebook, simply ask for the object representation:\n" + "The `location` keyword argument (there are many more, with sensible defaults) provides the Map centre in Latitude and Longitude (Northing, Easting). To display the Map in a Jupyter notebook, simply ask for its object representation:\n" ] }, { @@ -124,7 +124,7 @@ "countries = f'../data/countries.json'\n", "\n", "folium_map2 = folium.Map(\n", - " location=[44.43225, 26.10626],\n", + " location=[0, 0],\n", " zoom_start=2 \n", ")\n", "\n", @@ -206,7 +206,7 @@ "source": [ "from ipyleaflet import *\n", "\n", - "m = Map(center=(44.4, 26.1), zoom=4, basemap=basemaps.OpenStreetMap.Mapnik)\n", + "m = Map(center=(-34.603722, -58.381592), zoom=3, basemap=basemaps.OpenStreetMap.Mapnik)\n", "m" ] }, @@ -214,7 +214,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### ipyleaflet - add overlay tiles\n" + "### ipyleaflet - add overlay tiles\n", + "This basemap is now transparently overlayed with tiles from the [Strava heatmap](https://www.strava.com/heatmap)." ] }, { @@ -341,7 +342,7 @@ "source": [ "import ipywidgets\n", " \n", - "ipywidgets.HBox([m, Map(center=[44.4, 26.1], zoom=8)])" + "ipywidgets.HBox([m, Map(center=[-34.603722, -58.381592], zoom=8)])" ] }, { @@ -563,7 +564,7 @@ "tile_provider = get_provider(Vendors.CARTODBPOSITRON)\n", "\n", "# range bounds supplied in web mercator coordinates\n", - "p = figure(tools='pan, wheel_zoom', x_range=(-2000000, 6000000), y_range=(-1000000, 7000000),\n", + "p = figure(tools='pan, wheel_zoom', x_range=(-10000000, -3000000), y_range=(-6000000, 0),\n", " x_axis_type='mercator', y_axis_type='mercator')\n", "p.add_tile(tile_provider)\n", "\n", @@ -599,7 +600,7 @@ "source": [ "import geopandas as gpd\n", "\n", - "# Read the data (already in Web Mercator projection\n", + "# Read the data (already in Web Mercator projection (ignore the warning)\n", "points = gpd.read_file('../data/populated_places.3857.gpkg')" ] }, diff --git a/workshop/jupyter/content/notebooks/test/07-folium-1.html b/workshop/jupyter/content/notebooks/test/07-folium-1.html index b932ec1..aea84a5 100644 --- a/workshop/jupyter/content/notebooks/test/07-folium-1.html +++ b/workshop/jupyter/content/notebooks/test/07-folium-1.html @@ -23,7 +23,7 @@