stimmenfryslan/notebooks/Show Province Segmentations.ipynb

154 lines
2.0 MiB
Plaintext
Raw Normal View History

2018-09-28 16:28:15 +02:00
{
"cells": [
2018-10-01 17:19:36 +02:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Show province segmentation\n",
"\n",
"In gemeentes and wijken as calculated in `Segment Provinces in Wijken and Gemeentes.ipynb`."
]
},
2018-09-28 16:28:15 +02:00
{
"cell_type": "code",
2018-09-28 16:42:18 +02:00
"execution_count": 2,
2018-09-28 16:28:15 +02:00
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
2018-09-28 16:42:18 +02:00
"execution_count": 3,
2018-09-28 16:28:15 +02:00
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"sys.path.append('../')\n",
"import json\n",
"\n",
"from stimmen.latitude_longitude import reverse_latitude_longitude\n",
"import folium\n",
"\n",
"from stimmen.cbs import get_available_provinces, province_geojson\n",
"from shapely.geometry import shape\n",
"\n",
"import folium\n",
"from IPython.display import display"
]
},
{
"cell_type": "code",
2018-09-28 16:42:18 +02:00
"execution_count": 4,
2018-10-01 17:19:36 +02:00
"metadata": {
"scrolled": false
},
2018-09-28 16:28:15 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Groningen\n"
]
},
{
"data": {
"text/html": [
2018-09-28 16:42:18 +02:00
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD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A4OV0sIFs1My4zMjcxMTUxMjMwMjA3NiwgNi44MzQ0NTY5NTMzMTE5Nl0sIFs1My4zMzA1MzI4NzAwNzIyNywgNi44Mzg5MjUzMDk1MDYxNl0sIFs1My4zMzY4MTMwMDM4MTgwNSwgNi44MzM3MzE3NDY4NzQ0MzRdLCBbNTMuMzQwMDU2MTY1MzIxNjgsIDYuODM0NTMyODA4NDY1MzU0XSwgWzUzLjM0MTg0NzYzNzE0MjEsIDYuODMzMTU4OTM0ODU1OTU2XSwgWzUzLjM0NTEzMDkxNjU2ODc5LCA2LjgzNjE1MDg0MjU4MjAwNF0sIFs1My4zNDU1NDE0NzkyNTIyLCA2Ljg0MTczODQ3MjU3OTU4NjRdLCBbNTMuMzQzNTA4MDY2MzkxODgsIDYuODQ0NTI2OTA5N
2018-09-28 16:28:15 +02:00
],
"text/plain": [
2018-09-28 16:42:18 +02:00
"<folium.folium.Map at 0x7f32343b8fd0>"
2018-09-28 16:28:15 +02:00
]
},
"metadata": {},
"output_type": "display_data"
},
{
2018-09-28 16:42:18 +02:00
"name": "stdout",
"output_type": "stream",
"text": [
"Friesland\n"
2018-09-28 16:28:15 +02:00
]
2018-09-28 16:42:18 +02:00
},
{
"data": {
"text/html": [
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL2xlYWZsZXRAMS4yLjAvZGlzdC9sZW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ODQ4MjUsIDUuOTc0NjE3MTA1Mjc0NTE5XSwgWzUzLjMzMTM2ODc0ODI0NjY3LCA1Ljk3MTExODQ1ODM5MDc5NV0sIFs1My4zMzQwMTIxNzgwNTQ1OSwgNS45NzI5MDE0MDMyODA5N10sIFs1My4zMzQ2NjA3OTczMDcwMTYsIDUuOTg4ODI4MjQwNTEwMDc4XSwgWzUzLjMzNjA5MTg2NTI4ODU0NSwgNS45ODk2NTIxNDM0OTI1NTJdLCBbNTMuMzM0NzYyNTg1NDMwMjM0LCA1Ljk5NTUxNjYyNjU4NzQwNV0sIFs1My4zMzc3MTA5ODc5MjEyMywgNi4wM
],
"text/plain": [
"<folium.folium.Map at 0x7f32343b8f98>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Zeeland\n"
]
},
{
"data": {
"text/html": [
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL2xlYWZsZXRAMS4yLjAvZGlzdC9sZWFmbGV0LmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2FqYXguZ29vZ2xlYXBpcy5jb20vYWpheC9saWJzL2pxdWVyeS8xLjExLjEvanF1ZXJ5Lm1pbi5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0IHNyYz0iaHR0cHM6Ly9tYXhjZG4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MzQ2XSwgWzUxLjQyNjkwNjQ5NjQzMjM0NSwgMy44ODUyODE3NDc3MzYyODRdLCBbNTEuNDE4NDQ2OTcxNDEyNCwgMy44ODUwMDMyOTI3MDIzODQ4XSwgWzUxLjQxNzE0NjExNzY0MjAxLCAzL
],
"text/plain": [
"<folium.folium.Map at 0x7f3200f766d8>"
]
},
"metadata": {},
"output_type": "display_data"
2018-09-28 16:28:15 +02:00
}
],
"source": [
"for province in ['Groningen', 'Friesland', 'Zeeland']:\n",
" center = shape(province_geojson(province, with_water=True)['geometry']).centroid\n",
"\n",
" m = folium.Map((center.y, center.x), tiles='stamentoner', zoom_start=9)\n",
" \n",
" with open('../data/{}_gemeentes.geojson'.format(province), 'r') as f:\n",
" gemeentes = json.load(f)\n",
" with open('../data/{}_wijken.geojson'.format(province), 'r') as f:\n",
" wijken = json.load(f)\n",
" \n",
" for feature in wijken['features']:\n",
" coordinates = reverse_latitude_longitude(feature['geometry']['coordinates'])\n",
" polygon = folium.Polygon(coordinates, fill_color=None, color='blue').add_to(m)\n",
" \n",
" for feature in gemeentes['features']:\n",
" coordinates = reverse_latitude_longitude(feature['geometry']['coordinates'])\n",
" polygon = folium.Polygon(coordinates, fill_color=None, color='red').add_to(m)\n",
" \n",
" print(province)\n",
" display(m)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}