Skip to content

Commit fb009ad

Browse files
committed
ran notebooks so output was included.
1 parent 356c21d commit fb009ad

File tree

3 files changed

+151
-39
lines changed

3 files changed

+151
-39
lines changed

labs/create_data.ipynb

Lines changed: 66 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,27 @@
1818
"from arcgis.gis import *\n",
1919
"\n",
2020
"password = getpass.getpass(\"Please enter password: \")\n",
21-
"dev_gis = GIS('https://www.arcgis.com', 'johnnyDev', password)\n",
21+
"dev_gis = GIS('https://www.arcgis.com', 'username', password)\n",
2222
"print(\"Successfully logged in to {} as {}\".format(dev_gis.properties.urlKey + '.' + dev_gis.properties.customBaseUrl,\n",
2323
" dev_gis.users.me.username))"
2424
]
2525
},
2626
{
2727
"cell_type": "code",
28-
"execution_count": null,
28+
"execution_count": 2,
2929
"metadata": {},
30-
"outputs": [],
30+
"outputs": [
31+
{
32+
"data": {
33+
"text/plain": [
34+
"[<Item title:\"Griffith Park Access2\" type:Feature Layer Collection owner:johnnyDev>]"
35+
]
36+
},
37+
"execution_count": 2,
38+
"metadata": {},
39+
"output_type": "execute_result"
40+
}
41+
],
3142
"source": [
3243
"feature_layer_srch_results = dev_gis.content.search(query='title: \"Griffith*\" AND type: \"Feature Service\"', \n",
3344
" max_items=10)\n",
@@ -36,9 +47,20 @@
3647
},
3748
{
3849
"cell_type": "code",
39-
"execution_count": null,
50+
"execution_count": 3,
4051
"metadata": {},
41-
"outputs": [],
52+
"outputs": [
53+
{
54+
"data": {
55+
"text/plain": [
56+
"'griffith_park_access2'"
57+
]
58+
},
59+
"execution_count": 3,
60+
"metadata": {},
61+
"output_type": "execute_result"
62+
}
63+
],
4264
"source": [
4365
"feature_layer_coll_item = feature_layer_srch_results[0]\n",
4466
"feature_layers = feature_layer_coll_item.layers\n",
@@ -48,17 +70,28 @@
4870
},
4971
{
5072
"cell_type": "code",
51-
"execution_count": null,
73+
"execution_count": 4,
5274
"metadata": {},
53-
"outputs": [],
75+
"outputs": [
76+
{
77+
"name": "stdout",
78+
"output_type": "stream",
79+
"text": [
80+
"OBJECTID\n",
81+
"name\n",
82+
"type\n",
83+
"surface\n"
84+
]
85+
}
86+
],
5487
"source": [
5588
"for field in feature_layer.properties['fields']:\n",
5689
" print(field['name'])"
5790
]
5891
},
5992
{
6093
"cell_type": "code",
61-
"execution_count": null,
94+
"execution_count": 5,
6295
"metadata": {
6396
"collapsed": true
6497
},
@@ -69,6 +102,7 @@
69102
"\n",
70103
"def create_feature(map1, g):\n",
71104
" try:\n",
105+
" oid = 1\n",
72106
" pt = geometry.Point(g)\n",
73107
" feat = features.Feature(geometry=pt, attributes={'OBJECTID': 1,\n",
74108
" 'name': 'name',\n",
@@ -83,17 +117,36 @@
83117
},
84118
{
85119
"cell_type": "code",
86-
"execution_count": null,
120+
"execution_count": 6,
87121
"metadata": {},
88-
"outputs": [],
122+
"outputs": [
123+
{
124+
"data": {
125+
"application/vnd.jupyter.widget-view+json": {
126+
"model_id": "57be67419bbb49babb30726e9d29aa91"
127+
}
128+
},
129+
"metadata": {},
130+
"output_type": "display_data"
131+
},
132+
{
133+
"name": "stdout",
134+
"output_type": "stream",
135+
"text": [
136+
"{'y': 4031785.200371807, 'type': 'point', 'spatialReference': {'latestWkid': 3857, 'wkid': 102100}, 'x': -13174326.588164143}\n",
137+
"{'y': 4039276.029143757, 'type': 'point', 'spatialReference': {'latestWkid': 3857, 'wkid': 102100}, 'x': -13181205.920709811}\n",
138+
"{'y': 4024447.2456564275, 'type': 'point', 'spatialReference': {'latestWkid': 3857, 'wkid': 102100}, 'x': -13167447.255618475}\n"
139+
]
140+
}
141+
],
89142
"source": [
90143
"map1 = dev_gis.map('Los Angeles', 10)\n",
91144
"map1"
92145
]
93146
},
94147
{
95148
"cell_type": "code",
96-
"execution_count": null,
149+
"execution_count": 7,
97150
"metadata": {
98151
"collapsed": true
99152
},
@@ -104,7 +157,7 @@
104157
},
105158
{
106159
"cell_type": "code",
107-
"execution_count": null,
160+
"execution_count": 8,
108161
"metadata": {
109162
"collapsed": true
110163
},
@@ -115,7 +168,7 @@
115168
},
116169
{
117170
"cell_type": "code",
118-
"execution_count": null,
171+
"execution_count": 9,
119172
"metadata": {
120173
"collapsed": true
121174
},

labs/download_data.ipynb

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": null,
19+
"execution_count": 1,
2020
"metadata": {
2121
"collapsed": true
2222
},
@@ -29,7 +29,7 @@
2929
},
3030
{
3131
"cell_type": "code",
32-
"execution_count": null,
32+
"execution_count": 2,
3333
"metadata": {
3434
"collapsed": true
3535
},
@@ -40,7 +40,7 @@
4040
},
4141
{
4242
"cell_type": "code",
43-
"execution_count": null,
43+
"execution_count": 3,
4444
"metadata": {
4545
"collapsed": true
4646
},
@@ -51,26 +51,66 @@
5151
},
5252
{
5353
"cell_type": "code",
54-
"execution_count": null,
54+
"execution_count": 4,
5555
"metadata": {},
56-
"outputs": [],
56+
"outputs": [
57+
{
58+
"data": {
59+
"text/html": [
60+
"<div class=\"item_container\" style=\"height: auto; overflow: hidden; border: 1px solid #cfcfcf; border-radius: 2px; background: #f6fafa; line-height: 1.21429em; padding: 10px;\">\n",
61+
" <div class=\"item_left\" style=\"width: 210px; float: left;\">\n",
62+
" <a href='http://www.arcgis.com/home/item.html?id=a04933c045714492bda6886f355416f2' target='_blank'>\n",
63+
" <img src='http://www.arcgis.com/sharing/rest//content/items/a04933c045714492bda6886f355416f2/info/thumbnail/la_hub_data_thumb.png' class=\"itemThumbnail\">\n",
64+
" </a>\n",
65+
" </div>\n",
66+
"\n",
67+
" <div class=\"item_right\" style=\"float: none; width: auto; overflow: hidden;\">\n",
68+
" <a href='http://www.arcgis.com/home/item.html?id=a04933c045714492bda6886f355416f2' target='_blank'><b>LA_Hub_Datasets</b>\n",
69+
" </a>\n",
70+
" <br/>Datasets for ArcGIS DevLabs<img src='http://www.arcgis.com/home/js/jsapi/esri/css/images/item_type_icons/layers16.png' style=\"vertical-align:middle;\">Code Sample by esri_devlabs\n",
71+
" <br/>Last Modified: June 22, 2017\n",
72+
" <br/>0 comments, 1,540 views\n",
73+
" </div>\n",
74+
" </div>\n",
75+
" "
76+
],
77+
"text/plain": [
78+
"<Item title:\"LA_Hub_Datasets\" type:Code Sample owner:esri_devlabs>"
79+
]
80+
},
81+
"execution_count": 4,
82+
"metadata": {},
83+
"output_type": "execute_result"
84+
}
85+
],
5786
"source": [
5887
"data_item = anon_gis.content.get(public_data_item_id)\n",
5988
"data_item"
6089
]
6190
},
6291
{
6392
"cell_type": "code",
64-
"execution_count": null,
93+
"execution_count": 5,
6594
"metadata": {},
66-
"outputs": [],
95+
"outputs": [
96+
{
97+
"data": {
98+
"text/plain": [
99+
"'./LA_Hub_Datasets.zip'"
100+
]
101+
},
102+
"execution_count": 5,
103+
"metadata": {},
104+
"output_type": "execute_result"
105+
}
106+
],
67107
"source": [
68108
"data_item.download(save_path = r'./')"
69109
]
70110
},
71111
{
72112
"cell_type": "code",
73-
"execution_count": null,
113+
"execution_count": 6,
74114
"metadata": {
75115
"collapsed": true
76116
},
@@ -82,9 +122,20 @@
82122
},
83123
{
84124
"cell_type": "code",
85-
"execution_count": null,
125+
"execution_count": 7,
86126
"metadata": {},
87-
"outputs": [],
127+
"outputs": [
128+
{
129+
"data": {
130+
"text/plain": [
131+
"['__MACOSX', 'Parks and Open Space.zip', 'Trailheads.csv', 'Trails.geojson']"
132+
]
133+
},
134+
"execution_count": 7,
135+
"metadata": {},
136+
"output_type": "execute_result"
137+
}
138+
],
88139
"source": [
89140
"file_list = os.listdir(r'./LA_Hub_datasets/')\n",
90141
"file_list"

labs/import_data.ipynb

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
{
3131
"cell_type": "code",
32-
"execution_count": 7,
32+
"execution_count": 16,
3333
"metadata": {},
3434
"outputs": [
3535
{
@@ -41,15 +41,16 @@
4141
}
4242
],
4343
"source": [
44+
"from arcgis.gis import GIS\n",
4445
"import getpass\n",
4546
"\n",
4647
"password = getpass.getpass(\"Enter password, please: \")\n",
47-
"dev_gis = GIS('https://arcgis.com', 'johnnyDev', password)"
48+
"dev_gis = GIS('https://arcgis.com', 'username', password)"
4849
]
4950
},
5051
{
5152
"cell_type": "code",
52-
"execution_count": 8,
53+
"execution_count": 17,
5354
"metadata": {},
5455
"outputs": [],
5556
"source": [
@@ -62,21 +63,21 @@
6263
},
6364
{
6465
"cell_type": "code",
65-
"execution_count": 9,
66+
"execution_count": 18,
6667
"metadata": {},
6768
"outputs": [
6869
{
6970
"data": {
7071
"text/html": [
7172
"<div class=\"item_container\" style=\"height: auto; overflow: hidden; border: 1px solid #cfcfcf; border-radius: 2px; background: #f6fafa; line-height: 1.21429em; padding: 10px;\">\n",
7273
" <div class=\"item_left\" style=\"width: 210px; float: left;\">\n",
73-
" <a href='https://arcgis.com/home/item.html?id=21533c7b67e748b4bfb34a2bc5b0faa1' target='_blank'>\n",
74+
" <a href='https://arcgis.com/home/item.html?id=7d848422761f4d78bf986f9a1bc7ad1b' target='_blank'>\n",
7475
" <img src='http://static.arcgis.com/images/desktopapp.png' class=\"itemThumbnail\">\n",
7576
" </a>\n",
7677
" </div>\n",
7778
"\n",
7879
" <div class=\"item_right\" style=\"float: none; width: auto; overflow: hidden;\">\n",
79-
" <a href='https://arcgis.com/home/item.html?id=21533c7b67e748b4bfb34a2bc5b0faa1' target='_blank'><b>Parks and Open Space</b>\n",
80+
" <a href='https://arcgis.com/home/item.html?id=7d848422761f4d78bf986f9a1bc7ad1b' target='_blank'><b>Parks and Open Space</b>\n",
8081
" </a>\n",
8182
" <br/><img src='https://arcgis.com/home/js/jsapi/esri/css/images/item_type_icons/datafiles16.png' style=\"vertical-align:middle;\">Shapefile by johnnyDev\n",
8283
" <br/>Last Modified: September 28, 2017\n",
@@ -89,7 +90,7 @@
8990
"<Item title:\"Parks and Open Space\" type:Shapefile owner:johnnyDev>"
9091
]
9192
},
92-
"execution_count": 9,
93+
"execution_count": 18,
9394
"metadata": {},
9495
"output_type": "execute_result"
9596
}
@@ -100,22 +101,29 @@
100101
},
101102
{
102103
"cell_type": "code",
103-
"execution_count": null,
104-
"metadata": {
105-
"collapsed": true
106-
},
104+
"execution_count": 19,
105+
"metadata": {},
107106
"outputs": [],
108107
"source": [
109108
"parks_feature_layer = parks_shp.publish()"
110109
]
111110
},
112111
{
113112
"cell_type": "code",
114-
"execution_count": null,
115-
"metadata": {
116-
"collapsed": true
117-
},
118-
"outputs": [],
113+
"execution_count": 20,
114+
"metadata": {},
115+
"outputs": [
116+
{
117+
"data": {
118+
"text/plain": [
119+
"'https://services1.arcgis.com/uRIm5IkWjDXybgFb/arcgis/rest/services/Parks_and_Open_Space/FeatureServer'"
120+
]
121+
},
122+
"execution_count": 20,
123+
"metadata": {},
124+
"output_type": "execute_result"
125+
}
126+
],
119127
"source": [
120128
"parks_feature_layer.url"
121129
]

0 commit comments

Comments
 (0)