Skip to content

Commit

Permalink
#54 localized Visualization to Buenos Aires/South America
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed Sep 27, 2021
1 parent 4d040be commit 82d169c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
17 changes: 9 additions & 8 deletions workshop/jupyter/content/notebooks/07-visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -206,15 +206,16 @@
"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"
]
},
{
"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)."
]
},
{
Expand Down Expand Up @@ -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)])"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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')"
]
},
Expand Down
14 changes: 7 additions & 7 deletions workshop/jupyter/content/notebooks/test/07-folium-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_e8f847ba14fc459599ba687391913e5a {
#map_e75e66334dd34ab59ce186ce45d3da4f {
position: relative;
width: 100.0%;
height: 100.0%;
Expand All @@ -35,15 +35,15 @@
</head>
<body>

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

</body>
<script>

var map_e8f847ba14fc459599ba687391913e5a = L.map(
"map_e8f847ba14fc459599ba687391913e5a",
var map_e75e66334dd34ab59ce186ce45d3da4f = L.map(
"map_e75e66334dd34ab59ce186ce45d3da4f",
{
center: [44.43225, 26.10626],
center: [-34.603722, -58.381592],
crs: L.CRS.EPSG3857,
zoom: 10,
zoomControl: true,
Expand All @@ -55,9 +55,9 @@



var tile_layer_16262fa238e443a39c7c51a6cd64e0dd = L.tileLayer(
var tile_layer_76694626c2334a5eaf394ea07c6a1b63 = L.tileLayer(
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
{"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}
).addTo(map_e8f847ba14fc459599ba687391913e5a);
).addTo(map_e75e66334dd34ab59ce186ce45d3da4f);

</script>
40 changes: 20 additions & 20 deletions workshop/jupyter/content/notebooks/test/07-folium-2.html

Large diffs are not rendered by default.

0 comments on commit 82d169c

Please sign in to comment.