Skip to content

Commit da1145e

Browse files
committed
remove map widget output and add layers before zooming to them
1 parent ec641fd commit da1145e

File tree

1 file changed

+22
-189
lines changed

1 file changed

+22
-189
lines changed

samples/04_gis_analysts_data_scientists/which_areas_are_good_cougar_habitat.ipynb

Lines changed: 22 additions & 189 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,7 @@
265265
{
266266
"cell_type": "code",
267267
"execution_count": null,
268-
"metadata": {
269-
"scrolled": false
270-
},
268+
"metadata": {},
271269
"outputs": [],
272270
"source": [
273271
"m1 = gis.map('oregon')\n",
@@ -382,48 +380,9 @@
382380
},
383381
{
384382
"cell_type": "code",
385-
"execution_count": 12,
383+
"execution_count": null,
386384
"metadata": {},
387-
"outputs": [
388-
{
389-
"data": {
390-
"application/vnd.jupyter.widget-view+json": {
391-
"model_id": "ab5623576bb841dab4e73c4cc286581d",
392-
"version_major": 2,
393-
"version_minor": 0
394-
},
395-
"text/plain": [
396-
"MapView(layout=Layout(height='400px', width='100%'))"
397-
]
398-
},
399-
"metadata": {},
400-
"output_type": "display_data"
401-
},
402-
{
403-
"data": {
404-
"text/html": [
405-
"<div class=\"map-static-img-preview-c07ea64f-45b8-4af7-b221-92c88131d277\"><img src=\"\"></img></div>"
406-
],
407-
"text/plain": [
408-
"<IPython.core.display.HTML object>"
409-
]
410-
},
411-
"metadata": {},
412-
"output_type": "display_data"
413-
},
414-
{
415-
"data": {
416-
"text/html": [
417-
"<div class=\"map-html-embed-preview-c07ea64f-45b8-4af7-b221-92c88131d277\"></div>"
418-
],
419-
"text/plain": [
420-
"<IPython.core.display.HTML object>"
421-
]
422-
},
423-
"metadata": {},
424-
"output_type": "display_data"
425-
}
426-
],
385+
"outputs": [],
427386
"source": [
428387
"m2 = gis.map('oregon')\n",
429388
"m2.basemap.basemap = 'gray-vector'\n",
@@ -444,8 +403,8 @@
444403
"metadata": {},
445404
"outputs": [],
446405
"source": [
447-
"m2.zoom_to_layer(buffer_park.layers[0])\n",
448-
"m2.content.add(buffer_park.layers[0])"
406+
"m2.content.add(buffer_park.layers[0])\n",
407+
"m2.zoom_to_layer(buffer_park.layers[0])"
449408
]
450409
},
451410
{
@@ -544,9 +503,7 @@
544503
{
545504
"cell_type": "code",
546505
"execution_count": null,
547-
"metadata": {
548-
"scrolled": false
549-
},
506+
"metadata": {},
550507
"outputs": [],
551508
"source": [
552509
"m3 = gis.map('oregon')\n",
@@ -568,8 +525,8 @@
568525
"metadata": {},
569526
"outputs": [],
570527
"source": [
571-
"m3.zoom_to_layer(state_area_boundary.layers[0])\n",
572-
"m3.content.add(state_area_boundary.layers[0])"
528+
"m3.content.add(state_area_boundary.layers[0])\n",
529+
"m3.zoom_to_layer(state_area_boundary.layers[0])"
573530
]
574531
},
575532
{
@@ -709,48 +666,9 @@
709666
},
710667
{
711668
"cell_type": "code",
712-
"execution_count": 23,
669+
"execution_count": null,
713670
"metadata": {},
714-
"outputs": [
715-
{
716-
"data": {
717-
"application/vnd.jupyter.widget-view+json": {
718-
"model_id": "7947391c8446406c806e03ebb063dcdf",
719-
"version_major": 2,
720-
"version_minor": 0
721-
},
722-
"text/plain": [
723-
"MapView(layout=Layout(height='400px', width='100%'))"
724-
]
725-
},
726-
"metadata": {},
727-
"output_type": "display_data"
728-
},
729-
{
730-
"data": {
731-
"text/html": [
732-
"<div class=\"map-static-img-preview-8adb4aaa-5113-437e-8618-642d2b43b10d\"><img src=\"\"></img></div>"
733-
],
734-
"text/plain": [
735-
"<IPython.core.display.HTML object>"
736-
]
737-
},
738-
"metadata": {},
739-
"output_type": "display_data"
740-
},
741-
{
742-
"data": {
743-
"text/html": [
744-
"<div class=\"map-html-embed-preview-8adb4aaa-5113-437e-8618-642d2b43b10d\"></div>"
745-
],
746-
"text/plain": [
747-
"<IPython.core.display.HTML object>"
748-
]
749-
},
750-
"metadata": {},
751-
"output_type": "display_data"
752-
}
753-
],
671+
"outputs": [],
754672
"source": [
755673
"m4 = gis.map('oregon')\n",
756674
"m4.basemap.basemap = 'gray-vector'\n",
@@ -770,9 +688,9 @@
770688
"metadata": {},
771689
"outputs": [],
772690
"source": [
773-
"m4.zoom_to_layer(clipped_highway_lyr)\n",
774691
"m4.content.add(state_area_boundary)\n",
775-
"m4.content.add(clipped_highway_lyr)"
692+
"m4.content.add(clipped_highway_lyr)\n",
693+
"m4.zoom_to_layer(clipped_highway_lyr)"
776694
]
777695
},
778696
{
@@ -876,48 +794,9 @@
876794
},
877795
{
878796
"cell_type": "code",
879-
"execution_count": 27,
797+
"execution_count": null,
880798
"metadata": {},
881-
"outputs": [
882-
{
883-
"data": {
884-
"application/vnd.jupyter.widget-view+json": {
885-
"model_id": "04b4c981fb1344ff96a6876c0cf2653f",
886-
"version_major": 2,
887-
"version_minor": 0
888-
},
889-
"text/plain": [
890-
"MapView(layout=Layout(height='400px', width='100%'))"
891-
]
892-
},
893-
"metadata": {},
894-
"output_type": "display_data"
895-
},
896-
{
897-
"data": {
898-
"text/html": [
899-
"<div class=\"map-static-img-preview-58a1e602-af97-418d-96e9-68443b14e4e2\"><img src=\"\"></img></div>"
900-
],
901-
"text/plain": [
902-
"<IPython.core.display.HTML object>"
903-
]
904-
},
905-
"metadata": {},
906-
"output_type": "display_data"
907-
},
908-
{
909-
"data": {
910-
"text/html": [
911-
"<div class=\"map-html-embed-preview-58a1e602-af97-418d-96e9-68443b14e4e2\"></div>"
912-
],
913-
"text/plain": [
914-
"<IPython.core.display.HTML object>"
915-
]
916-
},
917-
"metadata": {},
918-
"output_type": "display_data"
919-
}
920-
],
799+
"outputs": [],
921800
"source": [
922801
"m5 = gis.map('oregon')\n",
923802
"m5.basemap.basemap = 'gray-vector'\n",
@@ -938,8 +817,8 @@
938817
"metadata": {},
939818
"outputs": [],
940819
"source": [
941-
"m5.zoom_to_layer(potential_cougar_habitat_A.layers[0])\n",
942-
"m5.content.add(potential_cougar_habitat_A)"
820+
"m5.content.add(potential_cougar_habitat_A)\n",
821+
"m5.zoom_to_layer(potential_cougar_habitat_A.layers[0])"
943822
]
944823
},
945824
{
@@ -1000,48 +879,9 @@
1000879
},
1001880
{
1002881
"cell_type": "code",
1003-
"execution_count": 31,
882+
"execution_count": null,
1004883
"metadata": {},
1005-
"outputs": [
1006-
{
1007-
"data": {
1008-
"application/vnd.jupyter.widget-view+json": {
1009-
"model_id": "8491e423247f49b9ab6e0c5cf9b9d98e",
1010-
"version_major": 2,
1011-
"version_minor": 0
1012-
},
1013-
"text/plain": [
1014-
"MapView(layout=Layout(height='400px', width='100%'))"
1015-
]
1016-
},
1017-
"metadata": {},
1018-
"output_type": "display_data"
1019-
},
1020-
{
1021-
"data": {
1022-
"text/html": [
1023-
"<div class=\"map-static-img-preview-87b5446a-dec6-4d5f-b0a6-7c8e02458db6\"><img src=\"\"></img></div>"
1024-
],
1025-
"text/plain": [
1026-
"<IPython.core.display.HTML object>"
1027-
]
1028-
},
1029-
"metadata": {},
1030-
"output_type": "display_data"
1031-
},
1032-
{
1033-
"data": {
1034-
"text/html": [
1035-
"<div class=\"map-html-embed-preview-87b5446a-dec6-4d5f-b0a6-7c8e02458db6\"></div>"
1036-
],
1037-
"text/plain": [
1038-
"<IPython.core.display.HTML object>"
1039-
]
1040-
},
1041-
"metadata": {},
1042-
"output_type": "display_data"
1043-
}
1044-
],
884+
"outputs": [],
1045885
"source": [
1046886
"m6 = gis.map('oregon')\n",
1047887
"m6.basemap.basemap = 'gray-vector'\n",
@@ -1062,8 +902,8 @@
1062902
"metadata": {},
1063903
"outputs": [],
1064904
"source": [
1065-
"m6.zoom_to_layer(potential_cougar_habitat_B.layers[0])\n",
1066-
"m6.content.add(potential_cougar_habitat_B)"
905+
"m6.content.add(potential_cougar_habitat_B)\n",
906+
"m6.zoom_to_layer(potential_cougar_habitat_B.layers[0])"
1067907
]
1068908
},
1069909
{
@@ -1081,13 +921,6 @@
1081921
"\n",
1082922
"Thus, scientists from DFW and the national forest decide to work together to field check the results, looking for evidence of cougars inside, as well as outside, the potential habitat areas. "
1083923
]
1084-
},
1085-
{
1086-
"cell_type": "code",
1087-
"execution_count": null,
1088-
"metadata": {},
1089-
"outputs": [],
1090-
"source": []
1091924
}
1092925
],
1093926
"metadata": {
@@ -1110,9 +943,9 @@
1110943
"name": "python",
1111944
"nbconvert_exporter": "python",
1112945
"pygments_lexer": "ipython3",
1113-
"version": "3.9.11"
946+
"version": "3.11.0"
1114947
}
1115948
},
1116949
"nbformat": 4,
1117-
"nbformat_minor": 2
950+
"nbformat_minor": 4
1118951
}

0 commit comments

Comments
 (0)