Skip to content

Commit 0b49d72

Browse files
comments/suggestions addressed
1 parent de29566 commit 0b49d72

File tree

1 file changed

+53
-29
lines changed

1 file changed

+53
-29
lines changed

samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb

+53-29
Original file line numberDiff line numberDiff line change
@@ -202,28 +202,12 @@
202202
},
203203
{
204204
"cell_type": "code",
205-
"execution_count": 16,
205+
"execution_count": null,
206206
"metadata": {},
207-
"outputs": [
208-
{
209-
"data": {
210-
"application/vnd.jupyter.widget-view+json": {
211-
"model_id": "1a51d8d0698e41cc8204a3e1f93fc55c",
212-
"version_major": 2,
213-
"version_minor": 1
214-
},
215-
"text/plain": [
216-
"Map(center=[4035818.471878221, -13162788.84377388], extent={'xmin': -13195962.052030275, 'ymin': 3995849.73900…"
217-
]
218-
},
219-
"execution_count": 16,
220-
"metadata": {},
221-
"output_type": "execute_result"
222-
}
223-
],
207+
"outputs": [],
224208
"source": [
225209
"# create a map of our area of interest\n",
226-
"m = gis.map('Los Angeles', 9)\n",
210+
"m = gis.map('Los Angeles')\n",
227211
"m"
228212
]
229213
},
@@ -239,6 +223,15 @@
239223
"![fighting-1.png](attachment:fighting-1.png)"
240224
]
241225
},
226+
{
227+
"cell_type": "code",
228+
"execution_count": null,
229+
"metadata": {},
230+
"outputs": [],
231+
"source": [
232+
"m.zoom = 9"
233+
]
234+
},
242235
{
243236
"cell_type": "code",
244237
"execution_count": 17,
@@ -278,7 +271,7 @@
278271
"outputs": [],
279272
"source": [
280273
"# create a map of our area of interest\n",
281-
"m1 = gis.map('Los Angeles', 9)\n",
274+
"m1 = gis.map('Los Angeles')\n",
282275
"m1"
283276
]
284277
},
@@ -294,6 +287,15 @@
294287
"![fighting-2.png](attachment:fighting-2.png)"
295288
]
296289
},
290+
{
291+
"cell_type": "code",
292+
"execution_count": null,
293+
"metadata": {},
294+
"outputs": [],
295+
"source": [
296+
"m1.zoom = 9"
297+
]
298+
},
297299
{
298300
"cell_type": "code",
299301
"execution_count": 21,
@@ -439,7 +441,8 @@
439441
"cell_type": "code",
440442
"execution_count": null,
441443
"metadata": {},
442-
"outputs": [{
444+
"outputs": [
445+
{
443446
"data": {
444447
"text/html": [
445448
"<div>\n",
@@ -727,7 +730,8 @@
727730
"execution_count": 17,
728731
"metadata": {},
729732
"output_type": "execute_result"
730-
}],
733+
}
734+
],
731735
"source": [
732736
"at_risk_facilities = riskinfra.layers[0]\n",
733737
"df = at_risk_facilities.query(as_df=True) # read the returned features as a Pandas dataframe\n",
@@ -745,7 +749,8 @@
745749
"cell_type": "code",
746750
"execution_count": null,
747751
"metadata": {},
748-
"outputs": [{
752+
"outputs": [
753+
{
749754
"data": {
750755
"text/html": [
751756
"<div>\n",
@@ -841,7 +846,8 @@
841846
"execution_count": 18,
842847
"metadata": {},
843848
"output_type": "execute_result"
844-
}],
849+
}
850+
],
845851
"source": [
846852
"# view simplified risk facilities table\n",
847853
"df1_simplified = df[['name', 'cat1', 'post_id']]\n",
@@ -875,7 +881,7 @@
875881
"outputs": [],
876882
"source": [
877883
"# create new map over aoi\n",
878-
"m2 = gis.map('Los Angeles', 9)\n",
884+
"m2 = gis.map('Los Angeles')\n",
879885
"m2"
880886
]
881887
},
@@ -891,6 +897,15 @@
891897
"![fighting-3.png](attachment:fighting-3.png)"
892898
]
893899
},
900+
{
901+
"cell_type": "code",
902+
"execution_count": null,
903+
"metadata": {},
904+
"outputs": [],
905+
"source": [
906+
"m2.zoom = 9"
907+
]
908+
},
894909
{
895910
"cell_type": "code",
896911
"execution_count": null,
@@ -988,7 +1003,7 @@
9881003
"source": [
9891004
"# read the operational layers in our webmap\n",
9901005
"for lyr in webmap.content.layers:\n",
991-
" if webmap.content.layers[0].properties['name'].startswith('At_Risk_Infrastructure'):\n",
1006+
" if lyr.properties['name'].startswith('At_Risk_Infrastructure'):\n",
9921007
" print(lyr.url)"
9931008
]
9941009
},
@@ -1019,7 +1034,7 @@
10191034
"# update the url of the 'At Risk Infrastructure' layer in the web map\n",
10201035
"\n",
10211036
"for lyr in webmap.content.layers:\n",
1022-
" if webmap.content.layers[0].properties['name'].startswith('At_Risk_Infrastructure'):\n",
1037+
" if lyr.properties['name'].startswith('At_Risk_Infrastructure'):\n",
10231038
" lyr.url = new_url"
10241039
]
10251040
},
@@ -1046,7 +1061,7 @@
10461061
"metadata": {},
10471062
"outputs": [],
10481063
"source": [
1049-
"m3 = gis.map('Los Angeles', 9)\n",
1064+
"m3 = gis.map('Los Angeles')\n",
10501065
"m3"
10511066
]
10521067
},
@@ -1062,6 +1077,15 @@
10621077
"![fighting-4.png](attachment:fighting-4.png)"
10631078
]
10641079
},
1080+
{
1081+
"cell_type": "code",
1082+
"execution_count": null,
1083+
"metadata": {},
1084+
"outputs": [],
1085+
"source": [
1086+
"m3.zoom = 9"
1087+
]
1088+
},
10651089
{
10661090
"cell_type": "code",
10671091
"execution_count": 9,
@@ -1150,7 +1174,7 @@
11501174
"name": "python",
11511175
"nbconvert_exporter": "python",
11521176
"pygments_lexer": "ipython3",
1153-
"version": "3.11.0"
1177+
"version": "3.11.10"
11541178
},
11551179
"toc": {
11561180
"base_numbering": 1,

0 commit comments

Comments
 (0)