kopia lustrzana https://github.com/anitagraser/ogd-at-lab
Porównaj commity
4 Commity
772ac602fe
...
f2c7bdea96
Autor | SHA1 | Data |
---|---|---|
Anita Graser | f2c7bdea96 | |
Anita Graser | 7df1b60a2b | |
Anita Graser | 3776d2f806 | |
Anita Graser | 89bd009ff2 |
|
@ -92,7 +92,63 @@
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"col = 'airtemp °C'\n",
|
"col = 'airtemp °C'\n",
|
||||||
"stations.join(air_quality).dropna(subset=[col]).hvplot(geo=True, tiles='StamenToner', c=col, size=500, title=col.title())"
|
"stations = stations.join(air_quality).dropna(subset=[col])"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"stations.hvplot(geo=True, tiles='StamenToner', c=col, size=500, title=col.title())"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from holoviews.selection import link_selections"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"my_map = stations.hvplot(geo=True, tiles='CartoLight', c=col, cmap='Viridis', size=200, title=col.title(), width=400, height=250)\n",
|
||||||
|
"my_scatter = pd.DataFrame(stations).hvplot.scatter(x='airtemp °C', y='windspeed kmh', width=250, height=250)\n",
|
||||||
|
"my_hist = pd.DataFrame(stations).hvplot.hist('airtemp °C', width=250, height=250)\n",
|
||||||
|
"link_selections(my_map + my_hist + my_scatter , index_cols=['id'])"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import panel as pn"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"def my_plot(my_col='airtemp °C'):\n",
|
||||||
|
" try: \n",
|
||||||
|
" my_map = stations.hvplot(geo=True, tiles='CartoLight', c=my_col, cmap='Viridis', size=200, title=my_col, width=400, height=250)\n",
|
||||||
|
" my_hist = pd.DataFrame(stations).hvplot.hist(my_col, title=my_col, width=250, height=250)\n",
|
||||||
|
" return link_selections(my_map + my_hist, index_cols=['id']) \n",
|
||||||
|
" except:\n",
|
||||||
|
" pass\n",
|
||||||
|
"kw = dict(my_col=air_quality.columns)\n",
|
||||||
|
"pn.interact(my_plot, **kw)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -105,7 +161,7 @@
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3",
|
"display_name": "Python 3 (ipykernel)",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
|
@ -119,7 +175,7 @@
|
||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.7.8"
|
"version": "3.7.15"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"kw = dict(user_input=\"Giefinggasse 2, 1210 Wien\", buffer_meters=(0,10000))\n",
|
"kw = dict(user_input=\"Giefinggasse 2, 1210 Wien\", buffer_meters=(1,10000))\n",
|
||||||
"pn.interact(my_plot, **kw)"
|
"pn.interact(my_plot, **kw)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.7.12"
|
"version": "3.7.15"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|
|
@ -133,7 +133,7 @@ def get_uber_movement_gdf():
|
||||||
gdf['MOVEMENT_ID'] = gdf['MOVEMENT_ID'].astype(int)
|
gdf['MOVEMENT_ID'] = gdf['MOVEMENT_ID'].astype(int)
|
||||||
gdf.set_index('MOVEMENT_ID', inplace=True)
|
gdf.set_index('MOVEMENT_ID', inplace=True)
|
||||||
|
|
||||||
file = 'uber_vienna-statistical_areas-2020-1-All-MonthlyAggregate.zip'
|
file = 'data/uber_vienna-statistical_areas-2020-1-All-MonthlyAggregate.zip'
|
||||||
url = 'https://github.com/anitagraser/ogd-at-lab-data/raw/main/uber/vienna-statistical_areas-2020-1-All-MonthlyAggregate.zip'
|
url = 'https://github.com/anitagraser/ogd-at-lab-data/raw/main/uber/vienna-statistical_areas-2020-1-All-MonthlyAggregate.zip'
|
||||||
if not exists(file):
|
if not exists(file):
|
||||||
urlretrieve(url, file)
|
urlretrieve(url, file)
|
||||||
|
|
|
@ -8,9 +8,10 @@
|
||||||
"\n",
|
"\n",
|
||||||
"[![Binder](http://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/anitagraser/ogd-at-lab/main?urlpath=lab/tree/notebooks/wien-ogd.ipynb)\n",
|
"[![Binder](http://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/anitagraser/ogd-at-lab/main?urlpath=lab/tree/notebooks/wien-ogd.ipynb)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
|
||||||
"<a href=\"https://www.data.gv.at/auftritte/?organisation=stadt-wien\"><img align=\"right\" src=\"./img/stadt-wien.png\"></a>\n",
|
"<a href=\"https://www.data.gv.at/auftritte/?organisation=stadt-wien\"><img align=\"right\" src=\"./img/stadt-wien.png\"></a>\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"This notebook demonstrates the use of vector data provided via WFS. For instructions on using WMS, see the [webmapping notebook](webmapping.ipynb).\n",
|
||||||
|
"\n",
|
||||||
"For more information on open government data in Vienna visit [digitales.wien.gv.at](https://digitales.wien.gv.at/site/open-data/)\n",
|
"For more information on open government data in Vienna visit [digitales.wien.gv.at](https://digitales.wien.gv.at/site/open-data/)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"For a full list of available datasets go to [data.gv.at](https://www.data.gv.at/auftritte/?organisation=stadt-wien&searchterm=&formatFilter%5B%5D=WFS)\n",
|
"For a full list of available datasets go to [data.gv.at](https://www.data.gv.at/auftritte/?organisation=stadt-wien&searchterm=&formatFilter%5B%5D=WFS)\n",
|
||||||
|
@ -95,7 +96,7 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"hvplot_with_buffer(gdf, 100, title='Citybike Stations') + hvplot_with_buffer(gdf2, 100, title='EV Charging Stations')"
|
"hvplot_with_buffer(gdf, 100, title='Bike Sharing Stations') + hvplot_with_buffer(gdf2, 100, title='EV Charging Stations')"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -118,7 +119,7 @@
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3",
|
"display_name": "Python 3 (ipykernel)",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
|
@ -132,7 +133,7 @@
|
||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.7.8"
|
"version": "3.7.15"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|
Ładowanie…
Reference in New Issue