kopia lustrzana https://github.com/anitagraser/ogd-at-lab
Add interactive geocoding panel
rodzic
bf18adc249
commit
b05bdfe914
|
@ -89,6 +89,45 @@
|
|||
"map_plot * gdf.hvplot(geo=True).opts(active_tools=['wheel_zoom']) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Interactive geocoding application with Panel "
|
||||
]
|
||||
},
|
||||
{
|
||||
"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(user_input=\"Giefinggasse 2, 1210 Wien\"):\n",
|
||||
" location = locator.geocode(user_input)\n",
|
||||
" geocoded_gdf = location_to_gdf(location, address)\n",
|
||||
" map_plot = hvplot_with_buffer(geocoded_gdf, 1000, title='Geocoded address with buffer')\n",
|
||||
" return map_plot.opts(active_tools=['wheel_zoom']) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"kw = dict(user_input=\"Giefinggasse 2, 1210 Wien\")\n",
|
||||
"pn.interact(my_plot, **kw)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
@ -99,7 +138,7 @@
|
|||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
@ -113,7 +152,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.8"
|
||||
"version": "3.7.10"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
Ładowanie…
Reference in New Issue