Skip to content

Commit 249f649

Browse files
committed
make code changes
1 parent 3d27476 commit 249f649

File tree

1 file changed

+47
-8
lines changed

1 file changed

+47
-8
lines changed

samples/02_power_users_developers/openstreetmap_exploration.ipynb

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@
366366
"source": [
367367
"dc_map = gis.map('Washington DC')\n",
368368
"\n",
369-
"dc_map.draw(dc_df.iloc[0].SHAPE)\n",
370-
"dc_map.draw(dc_df.spatial.bbox)\n",
369+
"dc_map.content.draw(dc_df.iloc[0].SHAPE)\n",
370+
"dc_map.content.draw(dc_df.spatial.bbox)\n",
371371
"\n",
372372
"display(dc_map)\n",
373373
"\n",
@@ -404,8 +404,8 @@
404404
"pr_map = gis.map('Paris')\n",
405405
"\n",
406406
"pr_dis = dissolve_boundaries(pr_fl).query().sdf.iloc[0].SHAPE\n",
407-
"pr_map.draw(pr_dis)\n",
408-
"pr_map.draw(pr_df.spatial.bbox)\n",
407+
"pr_map.content.draw(pr_dis)\n",
408+
"pr_map.content.draw(pr_df.spatial.bbox)\n",
409409
"\n",
410410
"display(pr_map)\n",
411411
"\n",
@@ -989,20 +989,48 @@
989989
"dc_osm_df.columns = dc_osm_df.columns.str.replace(\"recycling:\", \"rec\")\n",
990990
"dc_osm_df.SHAPE = dc_osm_df.geom\n",
991991
"\n",
992-
"dc_osm_df.spatial.plot(map_widget=dc_map, renderer_type='u', col='recycling_type')\n",
992+
"dc_osm_df.spatial.plot(map_widget=dc_map)\n",
993993
"\n",
994994
"\n",
995995
"pr_osm_df = runner.gen_osm_df('point', pr_bounds, {'amenity': [\"recycling\"]})\n",
996996
"\n",
997997
"pr_osm_df.columns = pr_osm_df.columns.str.replace(\"recycling:\", \"rec\")\n",
998998
"pr_osm_df.SHAPE = pr_osm_df.geom\n",
999999
"\n",
1000-
"pr_osm_df.spatial.plot(map_widget=pr_map, renderer_type='u', col='recycling_type')\n",
1000+
"pr_osm_df.spatial.plot(map_widget=pr_map)\n",
10011001
"\n",
10021002
"display(dc_osm_df.head(n=1))\n",
10031003
"display(pr_osm_df.head(n=1))"
10041004
]
10051005
},
1006+
{
1007+
"cell_type": "code",
1008+
"execution_count": null,
1009+
"metadata": {},
1010+
"outputs": [],
1011+
"source": [
1012+
"rend1 = dc_map.content.renderer(2) # plotted dc_osm_df\n",
1013+
"rend2 = pr_map.content.renderer(2) # plotted pr_osm_df"
1014+
]
1015+
},
1016+
{
1017+
"cell_type": "code",
1018+
"execution_count": null,
1019+
"metadata": {},
1020+
"outputs": [],
1021+
"source": [
1022+
"rend1.smart_mapping().class_breaks_renderer(break_type=\"color\", field=\"recycling_type\")"
1023+
]
1024+
},
1025+
{
1026+
"cell_type": "code",
1027+
"execution_count": null,
1028+
"metadata": {},
1029+
"outputs": [],
1030+
"source": [
1031+
"rend2.smart_mapping().class_breaks_renderer(break_type=\"color\", field=\"recycling_type\")"
1032+
]
1033+
},
10061034
{
10071035
"cell_type": "markdown",
10081036
"metadata": {},
@@ -1124,7 +1152,8 @@
11241152
}
11251153
],
11261154
"source": [
1127-
"search_map = gis.map('Berlin', 12)\n",
1155+
"search_map = gis.map('Berlin')\n",
1156+
"search_map.zoom = 12\n",
11281157
"display(search_map)"
11291158
]
11301159
},
@@ -1168,7 +1197,7 @@
11681197
" print(f'OSM Coffee Shops Features Within Current Map View: {len(shop_df)}')\n",
11691198
" print(f'OSM Recycling Features Within Current Map View: {len(recy_df)}')\n",
11701199
"\n",
1171-
" recy_df.spatial.plot(map_widget=search_map, renderer_type='h')\n",
1200+
" recy_df.spatial.plot(map_widget=search_map)\n",
11721201
" shop_df.spatial.plot(map_widget=search_map)\n",
11731202
" \n",
11741203
"except Exception as e:\n",
@@ -1180,6 +1209,16 @@
11801209
" print(e)"
11811210
]
11821211
},
1212+
{
1213+
"cell_type": "code",
1214+
"execution_count": null,
1215+
"metadata": {},
1216+
"outputs": [],
1217+
"source": [
1218+
"recy_rend = search_map.content.renderer(0) # plotted recy_df\n",
1219+
"recy_rend.smart_mapping().heatmap()"
1220+
]
1221+
},
11831222
{
11841223
"cell_type": "markdown",
11851224
"metadata": {},

0 commit comments

Comments
 (0)