Skip to content

Commit 2895fb7

Browse files
committed
2 parents 3b2e94e + 36074b5 commit 2895fb7

29 files changed

+381818
-13
lines changed

guide/03-the-gis/accessing-and-managing-users.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,10 @@
449449
"source": [
450450
"<a id=\"creating-new-user-accounts\"></a>\n",
451451
"## Creating new user accounts\n",
452-
"You can add new users to the org using either the `signup()` or `create()` methods available on the `UserManager` class. The `signup()` method is limited in scope as it can be used only for adding built-in accounts to an ArcGIS Enterprise instance and not for an org that is hosted on ArcGIS Online. However, you can call the `signup()` anonymously and does not require admin privileges unlike the `create()` method. Note, you can disable self-signup in your ArcGIS Enterprise which would render the `signup()` unusable if you wanted to turn the org invite-only.\n",
452+
"You can add new users to the org using either the `signup()` or `create()` methods available on the `UserManager` class. The `signup()` method is limited in scope as it can be used only for adding built-in accounts to an ArcGIS Enterprise instance and not for an org that is hosted on ArcGIS Online. However, you can call the `signup()` anonymously and does not require admin privileges unlike the `create()` method. \n",
453+
"> Note, you can disable self-signup in your ArcGIS Enterprise which would render the `signup()` unusable if you wanted to turn the org invite-only.\n",
453454
"\n",
454-
"You need admin privileges to call the `create()` method. This method is powerful as it allows you to create new accounts from arcgis built-in credential store or your enterprise's credential store. In case of accounts from built-in credential store, you would provide a password when the account is created. The user can change it at any time once they login. For accounts from your enterprise's credential store, you can ignore the `password` parameter and your users will authenticate through that credential store.\n",
455+
"You need admin privileges to call the `create()` method. This method is very powerful in an instance of ArcGIS Enterprise, as it allows you to create new accounts from either the arcgis built-in credential store or your enterprise's credential store. For an ArcGIS Online Organization, you can only create users that will use the built-in credential store. For the case of accounts from a built-in credential store, you would provide a password when the account is created. The user can change it at any time once they login. For accounts from your enterprise's credential store, you can ignore the `password` parameter and your users will authenticate through that credential store.\n",
455456
"\n",
456457
"In addition to `role` that can be set, a `level` can be used to allocate accounts based on the privileges that members need. The level determines which privileges are available to the member. The enterprise offers two levels of membership. Level 1 membership is for members who only need privileges to **view** content, such as maps and apps, that has been shared with them through the organization, as well as join groups within the organization. Level 2 membership is for members who need to view, create, and share content and own groups, in addition to other tasks.\n",
457458
"\n",
@@ -521,7 +522,7 @@
521522
"cell_type": "markdown",
522523
"metadata": {},
523524
"source": [
524-
"Note that we specified `provider` as `arcgis`. If you were creating accounts from your enterprise credential store, you would specify this value as `enterprise` and use the `idpUsername` parameter to specify the username of the user in that credential store. To learn more about this configuration, refer to this help topic on [setting up enterprise logins](https://doc.arcgis.com/en/arcgis-online/administer/enterprise-logins.htm).\n",
525+
"> Note that we specified `arcgis` as the `provider` argument. If you were creating accounts from your enterprise credential store, you would specify this value as `enterprise` and use the `idpUsername` parameter to specify the username of the user in that credential store. To learn more about this configuration, refer to this help topic on [setting up enterprise logins](http://enterprise.arcgis.com/en/portal/latest/administer/windows/about-configuring-portal-authentication.htm#ESRI_SECTION1_83F7B85FEF594A6B96997AF3CADF3D38).\n",
525526
"\n",
526527
"Note, the `role` parameter was specified as `org_user`. This takes us to the next section on `Role` and `RoleManager` objects."
527528
]
@@ -1243,9 +1244,9 @@
12431244
"name": "python",
12441245
"nbconvert_exporter": "python",
12451246
"pygments_lexer": "ipython3",
1246-
"version": "3.5.3"
1247+
"version": "3.6.5"
12471248
}
12481249
},
12491250
"nbformat": 4,
1250-
"nbformat_minor": 1
1251+
"nbformat_minor": 2
12511252
}

guide/03-the-gis/managing-your-gis-servers.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,9 +1602,7 @@
16021602
{
16031603
"cell_type": "code",
16041604
"execution_count": 76,
1605-
"metadata": {
1606-
"collapsed": true
1607-
},
1605+
"metadata": {},
16081606
"outputs": [],
16091607
"source": [
16101608
"from datetime import datetime\n",
@@ -1644,7 +1642,7 @@
16441642
"df.index = df['date']\n",
16451643
"df['count'] = df['count'] \n",
16461644
"\n",
1647-
"ax = df.plot(kind='bar', x=df['date'])\n",
1645+
"ax = df['count'].plot(kind='bar', x=df['date'])\n",
16481646
"ticklabels = ['']*len(df.index)\n",
16491647
"ticklabels[::4] = [item.strftime('%b %d') for item in df.index[::4]]\n",
16501648
"ax.xaxis.set_major_formatter(ticker.FixedFormatter(ticklabels))\n",
@@ -2109,7 +2107,7 @@
21092107
"name": "python",
21102108
"nbconvert_exporter": "python",
21112109
"pygments_lexer": "ipython3",
2112-
"version": "3.5.3"
2110+
"version": "3.6.6"
21132111
}
21142112
},
21152113
"nbformat": 4,
Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Explore the Population!\n",
8+
"This Dashboard uses the Geoenrichment API to alow users to pan around the world and explore the population of a selected AOI. Let's start by logging into ArcGIS Online and loading the *"
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": 1,
14+
"metadata": {
15+
"extensions": {
16+
"jupyter_dashboards": {
17+
"version": 1,
18+
"views": {
19+
"grid_default": {
20+
"hidden": true
21+
},
22+
"report_default": {
23+
"hidden": true
24+
}
25+
}
26+
}
27+
}
28+
},
29+
"outputs": [],
30+
"source": [
31+
"from IPython.display import display, clear_output\n",
32+
"import ipywidgets as widgets\n",
33+
"\n",
34+
"from arcgis.features import SpatialDataFrame\n",
35+
"from arcgis.geoenrichment import enrich\n",
36+
"from arcgis.raster import ImageryLayer\n",
37+
"from arcgis.geometry import Geometry\n",
38+
"from arcgis.gis import GIS\n",
39+
"\n",
40+
"gis = GIS(\"http://www.arcgis.com/home\", \"name\", \"pword\")\n",
41+
"img_svc ='https://landscape7.arcgis.com/arcgis/rest/services/World_Population_Density_Estimate_2016/ImageServer/'\n",
42+
"img_lyr = ImageryLayer(img_svc, gis=gis)"
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": 2,
48+
"metadata": {
49+
"extensions": {
50+
"jupyter_dashboards": {
51+
"version": 1,
52+
"views": {
53+
"grid_default": {
54+
"col": 8,
55+
"height": 4,
56+
"hidden": false,
57+
"row": 24,
58+
"width": 4
59+
},
60+
"report_default": {}
61+
}
62+
}
63+
}
64+
},
65+
"outputs": [
66+
{
67+
"data": {
68+
"text/html": [
69+
"<style>\n",
70+
".intro {\n",
71+
" padding: 10px; \n",
72+
" color: #202020;\n",
73+
" font-family: 'Helvetica'\n",
74+
"}\n",
75+
".map {\n",
76+
" border: solid;\n",
77+
" height: 450;\n",
78+
"}\n",
79+
"</style>"
80+
],
81+
"text/plain": [
82+
"<IPython.core.display.HTML object>"
83+
]
84+
},
85+
"metadata": {},
86+
"output_type": "display_data"
87+
}
88+
],
89+
"source": [
90+
"%%html\n",
91+
"<style>\n",
92+
".intro {\n",
93+
" padding: 10px; \n",
94+
" color: #202020;\n",
95+
" font-family: 'Helvetica'\n",
96+
"}\n",
97+
".map {\n",
98+
" border: solid;\n",
99+
" height: 450;\n",
100+
"}\n",
101+
"</style>"
102+
]
103+
},
104+
{
105+
"cell_type": "code",
106+
"execution_count": 3,
107+
"metadata": {
108+
"extensions": {
109+
"jupyter_dashboards": {
110+
"version": 1,
111+
"views": {
112+
"grid_default": {
113+
"hidden": true
114+
},
115+
"report_default": {
116+
"hidden": true
117+
}
118+
}
119+
}
120+
}
121+
},
122+
"outputs": [],
123+
"source": [
124+
"# run_btn on_click\n",
125+
"def running(button_object):\n",
126+
" \n",
127+
" viz_map.clear_graphics()\n",
128+
"\n",
129+
" #print('GeoEnriched Cell Data')\n",
130+
" #print('-' * 75)\n",
131+
"\n",
132+
" the_geom = Geometry(viz_map.extent)\n",
133+
" enriched = SpatialDataFrame(enrich([the_geom], gis=gis))\n",
134+
" \n",
135+
" if 'TOTPOP' not in list(enriched):\n",
136+
" enriched_pop = -1\n",
137+
" else:\n",
138+
" enriched_pop = enriched.TOTPOP[0]\n",
139+
" \n",
140+
" samples = img_lyr.get_samples(the_geom.project_as(4326))# sample_count=img_lyr.properties.maxImageHeight)\n",
141+
" sample_sum = sum([float(sample['value']) for sample in samples])\n",
142+
" \n",
143+
" print('GeoEnrichment Population Results: {}'.format(enriched_pop))\n",
144+
" #print('the Geom: {}'.format(the_geom))\n",
145+
" #print('Sample Count: {}'.format(img_lyr.properties.maxImageHeight))\n",
146+
" #print('Image Server Results: {}'.format(sample_sum))\n",
147+
" \n",
148+
" title = 'GeoEnriched Cell'\n",
149+
"\n",
150+
" for feature in enriched.to_featureset():\n",
151+
" \n",
152+
" # Expand Attributes With New Lines\n",
153+
" content = \"{}\".format(\n",
154+
" '<br/>'.join(['%s: %s' % (key.upper(), value) for (key, value) in feature.attributes.items()])\n",
155+
" )\n",
156+
" \n",
157+
" # Add Cell to Map\n",
158+
" viz_map.draw(feature.geometry, popup={'title': title, 'content': content})\n",
159+
"\n",
160+
" #print('-' * 75)"
161+
]
162+
},
163+
{
164+
"cell_type": "code",
165+
"execution_count": 4,
166+
"metadata": {
167+
"extensions": {
168+
"jupyter_dashboards": {
169+
"version": 1,
170+
"views": {
171+
"grid_default": {
172+
"col": 0,
173+
"height": 24,
174+
"hidden": false,
175+
"row": 0,
176+
"width": null
177+
},
178+
"report_default": {
179+
"hidden": false
180+
}
181+
}
182+
}
183+
},
184+
"scrolled": false
185+
},
186+
"outputs": [
187+
{
188+
"data": {
189+
"application/vnd.jupyter.widget-view+json": {
190+
"model_id": "066baf6fe6154fa4a77ca91cb6ee1ab4",
191+
"version_major": 2,
192+
"version_minor": 0
193+
},
194+
"text/plain": [
195+
"MapView(basemaps=['dark-gray', 'dark-gray-vector', 'gray', 'gray-vector', 'hybrid', 'national-geographic', 'oc…"
196+
]
197+
},
198+
"metadata": {},
199+
"output_type": "display_data"
200+
},
201+
{
202+
"data": {
203+
"application/vnd.jupyter.widget-view+json": {
204+
"model_id": "1e9068b1e8bd4d8d975bc837a6453846",
205+
"version_major": 2,
206+
"version_minor": 0
207+
},
208+
"text/plain": [
209+
"HBox(children=(Button(button_style='success', description='Fetch Extent', layout=Layout(justify_content='cente…"
210+
]
211+
},
212+
"metadata": {},
213+
"output_type": "display_data"
214+
},
215+
{
216+
"name": "stdout",
217+
"output_type": "stream",
218+
"text": [
219+
"GeoEnrichment Population Results: 1146296\n",
220+
"GeoEnrichment Population Results: 321066\n"
221+
]
222+
}
223+
],
224+
"source": [
225+
"# Create & Display Map\n",
226+
"viz_map = gis.map('St Louis')\n",
227+
"viz_map.add_layer(img_lyr)\n",
228+
"display(viz_map)\n",
229+
"\n",
230+
"# Create Submit Button & Set on_click\n",
231+
"run_btn = widgets.Button(\n",
232+
" description='Fetch Extent',\n",
233+
" button_style='success',\n",
234+
" tooltip='Collect GeoEnrichment for Extent',\n",
235+
" layout=widgets.Layout(justify_content='center', margin='0px 0px 0px 10px')\n",
236+
")\n",
237+
"run_btn.on_click(running)\n",
238+
"\n",
239+
"# Handle Widget Layout\n",
240+
"params = widgets.HBox(\n",
241+
" [run_btn], \n",
242+
" layout=widgets.Layout(justify_content='center', margin='10px')\n",
243+
")\n",
244+
"display(params)"
245+
]
246+
},
247+
{
248+
"cell_type": "code",
249+
"execution_count": null,
250+
"metadata": {
251+
"extensions": {
252+
"jupyter_dashboards": {
253+
"version": 1,
254+
"views": {
255+
"grid_default": {},
256+
"report_default": {}
257+
}
258+
}
259+
}
260+
},
261+
"outputs": [],
262+
"source": []
263+
}
264+
],
265+
"metadata": {
266+
"extensions": {
267+
"jupyter_dashboards": {
268+
"activeView": "grid_default",
269+
"version": 1,
270+
"views": {
271+
"grid_default": {
272+
"cellMargin": 10,
273+
"defaultCellHeight": 20,
274+
"maxColumns": 12,
275+
"name": "grid",
276+
"type": "grid"
277+
},
278+
"report_default": {
279+
"name": "report",
280+
"type": "report"
281+
}
282+
}
283+
}
284+
},
285+
"kernelspec": {
286+
"display_name": "Python 3",
287+
"language": "python",
288+
"name": "python3"
289+
},
290+
"language_info": {
291+
"codemirror_mode": {
292+
"name": "ipython",
293+
"version": 3
294+
},
295+
"file_extension": ".py",
296+
"mimetype": "text/x-python",
297+
"name": "python",
298+
"nbconvert_exporter": "python",
299+
"pygments_lexer": "ipython3",
300+
"version": "3.6.5"
301+
}
302+
},
303+
"nbformat": 4,
304+
"nbformat_minor": 2
305+
}

samples/05_content_publishers/updating_features_in_a_feature_layer.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,7 @@
22622262
"\n",
22632263
"This method is editing intensive and you may choose this when the number of features to edit is less or if you needed to selectively update certain features as updates come in.\n",
22642264
"\n",
2265-
"An alternate method is to overwrite the feature layer altogether when you always have current information coming in. This method is explained in the sample [Overwriting feature layers](https://developers.arcgis.com/python/sample-notebook/overwriting-feature-layers)"
2265+
"An alternate method is to overwrite the feature layer altogether when you always have current information coming in. This method is explained in the sample [Overwriting feature layers](https://developers.arcgis.com/python/sample-notebooks/overwriting-feature-layers)"
22662266
]
22672267
}
22682268
],

0 commit comments

Comments
 (0)