Skip to content

Commit 82d169c

Browse files
committed
#54 localized Visualization to Buenos Aires/South America
1 parent 4d040be commit 82d169c

3 files changed

Lines changed: 36 additions & 35 deletions

File tree

workshop/jupyter/content/notebooks/07-visualization.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646
"source": [
4747
"import folium\n",
4848
"\n",
49-
"folium_map = folium.Map(location=[44.43225, 26.10626])"
49+
"folium_map = folium.Map(location=[-34.603722, -58.381592])"
5050
]
5151
},
5252
{
5353
"cell_type": "markdown",
5454
"metadata": {},
5555
"source": [
56-
"To display it in a Jupyter notebook, simply ask for the object representation:\n"
56+
"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"
5757
]
5858
},
5959
{
@@ -124,7 +124,7 @@
124124
"countries = f'../data/countries.json'\n",
125125
"\n",
126126
"folium_map2 = folium.Map(\n",
127-
" location=[44.43225, 26.10626],\n",
127+
" location=[0, 0],\n",
128128
" zoom_start=2 \n",
129129
")\n",
130130
"\n",
@@ -206,15 +206,16 @@
206206
"source": [
207207
"from ipyleaflet import *\n",
208208
"\n",
209-
"m = Map(center=(44.4, 26.1), zoom=4, basemap=basemaps.OpenStreetMap.Mapnik)\n",
209+
"m = Map(center=(-34.603722, -58.381592), zoom=3, basemap=basemaps.OpenStreetMap.Mapnik)\n",
210210
"m"
211211
]
212212
},
213213
{
214214
"cell_type": "markdown",
215215
"metadata": {},
216216
"source": [
217-
"### ipyleaflet - add overlay tiles\n"
217+
"### ipyleaflet - add overlay tiles\n",
218+
"This basemap is now transparently overlayed with tiles from the [Strava heatmap](https://www.strava.com/heatmap)."
218219
]
219220
},
220221
{
@@ -341,7 +342,7 @@
341342
"source": [
342343
"import ipywidgets\n",
343344
" \n",
344-
"ipywidgets.HBox([m, Map(center=[44.4, 26.1], zoom=8)])"
345+
"ipywidgets.HBox([m, Map(center=[-34.603722, -58.381592], zoom=8)])"
345346
]
346347
},
347348
{
@@ -563,7 +564,7 @@
563564
"tile_provider = get_provider(Vendors.CARTODBPOSITRON)\n",
564565
"\n",
565566
"# range bounds supplied in web mercator coordinates\n",
566-
"p = figure(tools='pan, wheel_zoom', x_range=(-2000000, 6000000), y_range=(-1000000, 7000000),\n",
567+
"p = figure(tools='pan, wheel_zoom', x_range=(-10000000, -3000000), y_range=(-6000000, 0),\n",
567568
" x_axis_type='mercator', y_axis_type='mercator')\n",
568569
"p.add_tile(tile_provider)\n",
569570
"\n",
@@ -599,7 +600,7 @@
599600
"source": [
600601
"import geopandas as gpd\n",
601602
"\n",
602-
"# Read the data (already in Web Mercator projection\n",
603+
"# Read the data (already in Web Mercator projection (ignore the warning)\n",
603604
"points = gpd.read_file('../data/populated_places.3857.gpkg')"
604605
]
605606
},

workshop/jupyter/content/notebooks/test/07-folium-1.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<meta name="viewport" content="width=device-width,
2424
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
2525
<style>
26-
#map_e8f847ba14fc459599ba687391913e5a {
26+
#map_e75e66334dd34ab59ce186ce45d3da4f {
2727
position: relative;
2828
width: 100.0%;
2929
height: 100.0%;
@@ -35,15 +35,15 @@
3535
</head>
3636
<body>
3737

38-
<div class="folium-map" id="map_e8f847ba14fc459599ba687391913e5a" ></div>
38+
<div class="folium-map" id="map_e75e66334dd34ab59ce186ce45d3da4f" ></div>
3939

4040
</body>
4141
<script>
4242

43-
var map_e8f847ba14fc459599ba687391913e5a = L.map(
44-
"map_e8f847ba14fc459599ba687391913e5a",
43+
var map_e75e66334dd34ab59ce186ce45d3da4f = L.map(
44+
"map_e75e66334dd34ab59ce186ce45d3da4f",
4545
{
46-
center: [44.43225, 26.10626],
46+
center: [-34.603722, -58.381592],
4747
crs: L.CRS.EPSG3857,
4848
zoom: 10,
4949
zoomControl: true,
@@ -55,9 +55,9 @@
5555

5656

5757

58-
var tile_layer_16262fa238e443a39c7c51a6cd64e0dd = L.tileLayer(
58+
var tile_layer_76694626c2334a5eaf394ea07c6a1b63 = L.tileLayer(
5959
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
6060
{"attribution": "Data by \u0026copy; \u003ca href=\"http://openstreetmap.org\"\u003eOpenStreetMap\u003c/a\u003e, under \u003ca href=\"http://www.openstreetmap.org/copyright\"\u003eODbL\u003c/a\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}
61-
).addTo(map_e8f847ba14fc459599ba687391913e5a);
61+
).addTo(map_e75e66334dd34ab59ce186ce45d3da4f);
6262

6363
</script>

workshop/jupyter/content/notebooks/test/07-folium-2.html

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)