Skip to content

Commit cd85607

Browse files
authored
Merge pull request #2065 from Esri/next
Merge changes from next branch into master for the 2.4 release.
2 parents ae7711c + 65da70a commit cd85607

File tree

138 files changed

+68758
-33352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+68758
-33352
lines changed

guide/02-api-overview/deprecation-notices.ipynb

Lines changed: 197 additions & 0 deletions
Large diffs are not rendered by default.

guide/02-api-overview/overview24.ipynb

Lines changed: 489 additions & 0 deletions
Large diffs are not rendered by default.

guide/02-api-overview/release_notes_240.ipynb

Lines changed: 513 additions & 0 deletions
Large diffs are not rendered by default.

guide/03-the-gis/accessing-and-creating-content.ipynb

Lines changed: 40 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,7 @@
3030
"cell_type": "code",
3131
"execution_count": 2,
3232
"metadata": {},
33-
"outputs": [
34-
{
35-
"name": "stderr",
36-
"output_type": "stream",
37-
"text": [
38-
"C:\\Users\\tar12555\\AppData\\Local\\ESRI\\conda\\envs\\pyapi-dev\\lib\\site-packages\\numpy\\_distributor_init.py:30: UserWarning: loaded more than 1 DLL from .libs:\n",
39-
"C:\\Users\\tar12555\\AppData\\Local\\ESRI\\conda\\envs\\pyapi-dev\\lib\\site-packages\\numpy\\.libs\\libopenblas64__v0.3.23-246-g3d31191b-gcc_10_3_0.dll\n",
40-
"C:\\Users\\tar12555\\AppData\\Local\\ESRI\\conda\\envs\\pyapi-dev\\lib\\site-packages\\numpy\\.libs\\libopenblas64__v0.3.23-gcc_10_3_0.dll\n",
41-
" warnings.warn(\"loaded more than 1 DLL from .libs:\"\n",
42-
"C:\\Users\\tar12555\\AppData\\Local\\ESRI\\conda\\envs\\pyapi-dev\\lib\\site-packages\\scipy\\__init__.py:138: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.25.2)\n",
43-
" warnings.warn(f\"A NumPy version >={np_minversion} and <{np_maxversion} is required for this version of \"\n"
44-
]
45-
}
46-
],
33+
"outputs": [],
4734
"source": [
4835
"import os\n",
4936
"import datetime as dt\n",
@@ -64,9 +51,9 @@
6451
"cell_type": "markdown",
6552
"metadata": {},
6653
"source": [
67-
"As mentioned in the [`gis module`](https://developers.arcgis.com/python/guide/the-gis-module/) guide, the Python API uses [Resource Manager classes](https://developers.arcgis.com/python/guide/the-gis-module/) to manage Web GIS users, groups, datastores, and content. You access the [`UserManager`](https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.UserManager), [`GroupManager`](https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#groupmanager) and [`ContentManager`](https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager) classes as the `users`, `groups`, and `content` properties of the [`GIS`](https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#gis), respectively. (See [`Helper objects`](https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#gis) for details.)\n",
54+
"As mentioned in the [`gis module`](/python/guide/the-gis-module/) guide, the Python API uses [Resource Manager classes](/python/guide/the-gis-module/) to manage Web GIS users, groups, datastores, and content. You access the [`UserManager`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.UserManager), [`GroupManager`](/python/api-reference/arcgis.gis.toc.html#groupmanager) and [`ContentManager`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager) classes as the `users`, `groups`, and `content` properties of the [`GIS`](/python/api-reference/arcgis.gis.toc.html#gis), respectively.\n",
6855
"\n",
69-
"Each resource manager implements the [ArcGIS REST API](https://developers.arcgis.com/rest/users-groups-and-items/search.htm) `search` operation as a method. For example, `gis.content.search()`. It's important to understand that the `search` mechanism uses many different inputs to find possible matches, ranks them and returns appropriate results. The `search` becomes ideal for human interaction, but `fuzzy` when looking for specific records programmatically. The search results are non-deterministic. Using `search` may not necessarily be the best approach for finding specific items, but more a group of items from which to further filter. \n",
56+
"Each search resource manager, for example _gis.content.search()_, implements the [ArcGIS REST API](/rest/users-groups-and-items/search.htm) `search` operation. It's important to understand that the `search` mechanism uses many different inputs to find possible matches, ranks them and returns appropriate results. The `search` becomes ideal for human interaction, but `fuzzy` when looking for specific records programmatically. The search results are non-deterministic. Using `search` may not necessarily be the best approach for finding specific items, but more a group of items from which to further filter. \n",
7057
"\n",
7158
"It's also important to know that using `search` programmatically, like with the Python API, does not correspond identically to searching with an application written in a different language. The various `search` options in the ArcGIS Online or Portal for ArcGIS Enterprise interfaces work differently than the Python API resource managers' `search`. Different applications may use different inputs. The relationship between a content `search` in one application, like a Portal or ArcGIS Online viewer, is not one-to-one with a content search using the Python API even when logged in as the same user.\n",
7259
"\n",
@@ -75,7 +62,7 @@
7562
},
7663
{
7764
"cell_type": "code",
78-
"execution_count": 2,
65+
"execution_count": 3,
7966
"metadata": {},
8067
"outputs": [],
8168
"source": [
@@ -203,12 +190,12 @@
203190
},
204191
{
205192
"cell_type": "code",
206-
"execution_count": 4,
193+
"execution_count": 37,
207194
"metadata": {},
208195
"outputs": [],
209196
"source": [
210-
"day_start = dt.datetime(2019, 5, 30, 0, 0, 0, 0)\n",
211-
"day_end = dt.datetime(2019, 5, 30, 23, 59, 59, 999999)\n",
197+
"day_start = dt.datetime(2023, 9, 21, 0, 0, 0, 0)\n",
198+
"day_end = dt.datetime(2023, 9, 21, 23, 59, 59, 999999)\n",
212199
"\n",
213200
"start_timestamp = int(day_start.timestamp() * 1000)\n",
214201
"end_timestamp = int(day_end.timestamp() * 1000)"
@@ -223,16 +210,17 @@
223210
},
224211
{
225212
"cell_type": "code",
226-
"execution_count": 5,
213+
"execution_count": 40,
227214
"metadata": {},
228215
"outputs": [],
229216
"source": [
230-
"content_published_53019 = [item\n",
231-
" for item in gis.content.search(query=\"* AND \\\n",
232-
" owner:\" + gis.users.me.username,\n",
233-
" max_items=50)\n",
234-
" if item.created > start_timestamp \n",
235-
" and item.created < end_timestamp]"
217+
"content_published_92123 = [\n",
218+
" item\n",
219+
" for item in gis.content.search(\n",
220+
" query=f\"owner:{gis.users.me.username}\",\n",
221+
" max_items=100) \n",
222+
" if item.created > start_timestamp\n",
223+
" and item.created < end_timestamp]"
236224
]
237225
},
238226
{
@@ -244,7 +232,7 @@
244232
},
245233
{
246234
"cell_type": "code",
247-
"execution_count": 6,
235+
"execution_count": 41,
248236
"metadata": {},
249237
"outputs": [],
250238
"source": [
@@ -254,14 +242,16 @@
254242
},
255243
{
256244
"cell_type": "code",
257-
"execution_count": 7,
245+
"execution_count": 45,
258246
"metadata": {},
259247
"outputs": [
260248
{
261249
"name": "stdout",
262250
"output_type": "stream",
263251
"text": [
264-
"Item Title Item Type Published \n"
252+
"Item Title Item Type Published \n",
253+
"425e9ee3dd774bbe8d472b73e9cadbd2 File Geodatabase September 21 2023 at 10:45.47 AM \n",
254+
"ad37530ecc3744e8b3a9db52adde6408 File Geodatabase September 21 2023 at 10:43.44 AM \n"
265255
]
266256
}
267257
],
@@ -271,8 +261,8 @@
271261
"publish = \"Published\"\n",
272262
"print(f\"{title:40}{item_type:25}{publish:40}\")\n",
273263
"\n",
274-
"for content in content_published_53019:\n",
275-
" print(f\" {content.title:<40} {content.type:25} {readable_date(content.created):40}\")"
264+
"for content in content_published_92123:\n",
265+
" print(f\"{content.title:<40}{content.type:25}{readable_date(content.created):40}\")"
276266
]
277267
},
278268
{
@@ -1435,11 +1425,11 @@
14351425
"source": [
14361426
"## Creating new content\n",
14371427
"\n",
1438-
"To create new items on your GIS, you use the [`add()`](https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager.add) method on a `ContentManager` instance. Again, rather than creating an instance of the `ContentManager` directly, the Python API implements the class as the `content` property of your `GIS` object.\n",
1428+
"To create new items on your GIS, use the [`add()`](/api-reference/arcgis.gis.toc.html#arcgis.gis._impl._content_manager.Folder.add) method on a [`Folder`](/python/api-reference/arcgis.gis.toc.html#folder) instance. You can get an individual _folder_ using the [`Folders.get()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis._impl._content_manager.Folders.get) method.\n",
14391429
"\n",
1440-
"The `add()` method accepts a dictionary containing the properties of the item to be created. The optional `data` parameter accepts a string path to a file. You can use the optional `metadata` parameter to specify an XML file containing metadata information.\n",
1430+
"The `add()` method accepts a dictionary containing the properties of the item to be created. The optional `file`, `text`, `url`, and `data_url` parameters accept input to add the actual content. \n",
14411431
"\n",
1442-
"All content you add this way is added to the authenticated user's contents. Let us connect to our Enterprise instance, add a csv file as an item and then publish a feature layer from it.\n",
1432+
"All content you add this way is added to the authenticated user's dolswe. Let us connect to our Enterprise instance, add a csv file as an item and then publish a feature layer from it.\n",
14431433
"\n",
14441434
"For example, set up a path to the data:\n",
14451435
"`data_path = os.path.join(r\"<your_drive>:\\\\\", \"path\", \"to\", \"data\")`"
@@ -1492,8 +1482,12 @@
14921482
" 'tags':'arcgis, python, earthquake, natural disaster, emergency'}\n",
14931483
"thumbnail_path = os.path.join(data_path, \"earthquake.png\")\n",
14941484
"\n",
1495-
"earthquake_csv_item = gis.content.add(item_properties=csv_properties, data=csv_path,\n",
1496-
" thumbnail = thumbnail_path)"
1485+
"root_folder = gis.content.folders.get()\n",
1486+
"earthquake_csv_item = root_folder.add(\n",
1487+
" item_properties=csv_properties, \n",
1488+
" data=csv_path,\n",
1489+
" thumbnail = thumbnail_path\n",
1490+
").result()"
14971491
]
14981492
},
14991493
{
@@ -1617,7 +1611,10 @@
16171611
{
16181612
"cell_type": "markdown",
16191613
"metadata": {
1620-
"collapsed": true
1614+
"collapsed": true,
1615+
"jupyter": {
1616+
"outputs_hidden": true
1617+
}
16211618
},
16221619
"source": [
16231620
"<a id=\"importing-data-from-a-pandas-data-frame\"></a>\n",
@@ -2325,7 +2322,7 @@
23252322
" 'tags': 'arcgis python api, pandas, csv',\n",
23262323
" 'text':ports_json,\n",
23272324
" 'type':'Feature Collection'}\n",
2328-
"ports_item = gis.content.add(ports_item_properties)\n",
2325+
"ports_item = root_folder.add(ports_item_properties).result()\n",
23292326
"ports_item"
23302327
]
23312328
},
@@ -2466,14 +2463,6 @@
24662463
"execution_count": 38,
24672464
"metadata": {},
24682465
"outputs": [
2469-
{
2470-
"name": "stderr",
2471-
"output_type": "stream",
2472-
"text": [
2473-
"C:\\Users\\tar12555\\AppData\\Local\\ESRI\\conda\\envs\\pyapi-dev\\lib\\site-packages\\IPython\\core\\interactiveshell.py:3553: DeprecatedWarning: create_folder is deprecated as of 2.3.0 and has be removed in 3.0.0. Use `gis.content.folders.create` instead.\n",
2474-
" exec(code_obj, self.user_global_ns, self.user_ns)\n"
2475-
]
2476-
},
24772466
{
24782467
"data": {
24792468
"text/plain": [
@@ -2489,7 +2478,7 @@
24892478
],
24902479
"source": [
24912480
"# create new folder\n",
2492-
"gis.content.create_folder(folder='ports')"
2481+
"gis.content.folders.create_folder(folder='ports')"
24932482
]
24942483
},
24952484
{
@@ -2552,14 +2541,6 @@
25522541
"execution_count": 41,
25532542
"metadata": {},
25542543
"outputs": [
2555-
{
2556-
"name": "stderr",
2557-
"output_type": "stream",
2558-
"text": [
2559-
"C:\\Users\\tar12555\\AppData\\Local\\ESRI\\conda\\envs\\pyapi-dev\\lib\\site-packages\\IPython\\core\\interactiveshell.py:3553: DeprecatedWarning: delete_folder is deprecated as of 2.3.0 and has be removed in 3.0.0. Use `Folder.delete()` instead.\n",
2560-
" exec(code_obj, self.user_global_ns, self.user_ns)\n"
2561-
]
2562-
},
25632544
{
25642545
"data": {
25652546
"text/plain": [
@@ -2572,7 +2553,7 @@
25722553
}
25732554
],
25742555
"source": [
2575-
"gis.content.delete_folder(folder='ports')"
2556+
"gis.content.folders.delete_folder(folder='ports')"
25762557
]
25772558
},
25782559
{
@@ -2601,7 +2582,7 @@
26012582
"name": "python",
26022583
"nbconvert_exporter": "python",
26032584
"pygments_lexer": "ipython3",
2604-
"version": "3.9.16"
2585+
"version": "3.11.0"
26052586
},
26062587
"toc": {
26072588
"base_numbering": 1,
@@ -2647,5 +2628,5 @@
26472628
}
26482629
},
26492630
"nbformat": 4,
2650-
"nbformat_minor": 1
2631+
"nbformat_minor": 4
26512632
}

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@
7171
{
7272
"cell_type": "markdown",
7373
"metadata": {
74-
"collapsed": true
74+
"collapsed": true,
75+
"jupyter": {
76+
"outputs_hidden": true
77+
}
7578
},
7679
"source": [
7780
"The `search()` method returns a list of objects of type `arcgis.gis.Group`. When using the Jupyter notebook environment, `Group` objects can be represented in rich HTML with their thumbnail and metadata information."
@@ -432,7 +435,11 @@
432435
"item_properties = {'title':'Hidden treasures',\n",
433436
" 'tags':['geocaching', 'searching', 'hikes', 'POI'],\n",
434437
" 'snippet':'Points containing treasures for geocaching activity'}\n",
435-
"fc_item = gis.content.add(item_properties, data='../../samples/05_content_publishers/data/hidden_treasures_geocaching.csv')"
438+
"root_folder = gis.content.folders.get()\n",
439+
"fc_item = root_folder.add(\n",
440+
" item_properties, \n",
441+
" data='../../samples/05_content_publishers/data/hidden_treasures_geocaching.csv'\n",
442+
").result()"
436443
]
437444
},
438445
{
@@ -470,7 +477,7 @@
470477
{
471478
"data": {
472479
"text/plain": [
473-
"{'notSharedWith': [], 'itemId': '538a4c39061043828f5d7a4d2a09c30b'}"
480+
"True"
474481
]
475482
},
476483
"execution_count": 162,
@@ -480,7 +487,7 @@
480487
],
481488
"source": [
482489
"# let us share it to the group so other enthusiasts can enjoy this map\n",
483-
"fc_item.share(groups=[geocaching_group])"
490+
"fc_item.sharing.groups.add(group=geocaching_group)"
484491
]
485492
},
486493
{
@@ -940,7 +947,7 @@
940947
"name": "python",
941948
"nbconvert_exporter": "python",
942949
"pygments_lexer": "ipython3",
943-
"version": "3.9.16"
950+
"version": "3.11.0"
944951
},
945952
"toc": {
946953
"base_numbering": 1,
@@ -957,5 +964,5 @@
957964
}
958965
},
959966
"nbformat": 4,
960-
"nbformat_minor": 1
967+
"nbformat_minor": 4
961968
}

guide/04-feature-data-and-analysis/analyzing-patterns-in-feature-data.ipynb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"metadata": {},
4848
"outputs": [],
4949
"source": [
50-
"map1 = gis.map(\"Tamil Nadu\", zoomlevel = 8)"
50+
"map1 = gis.map(\"Tamil Nadu\")"
5151
]
5252
},
5353
{
@@ -63,7 +63,7 @@
6363
"metadata": {},
6464
"outputs": [],
6565
"source": [
66-
"map1.add_layer(chennai_rainfall, { \"renderer\":\"ClassedSizeRenderer\", \"field_name\":\"RAINFALL\" })"
66+
"map1.content.add(chennai_rainfall)"
6767
]
6868
},
6969
{
@@ -87,6 +87,17 @@
8787
"![image-chennai-rainfall.png](attachment:image-chennai-rainfall.png)"
8888
]
8989
},
90+
{
91+
"cell_type": "code",
92+
"execution_count": null,
93+
"metadata": {},
94+
"outputs": [],
95+
"source": [
96+
"renderer_manager = map1.content.renderer(0)\n",
97+
"smart_map_manager = renderer_manager.smart_mapping()\n",
98+
"smart_map_manager.class_breaks_renderer(break_type=\"size\", field=\"RAINFALL\")"
99+
]
100+
},
90101
{
91102
"cell_type": "markdown",
92103
"metadata": {},
@@ -131,7 +142,7 @@
131142
"metadata": {},
132143
"outputs": [],
133144
"source": [
134-
"interpolated_map = gis.map(\"Tamil Nadu\", zoomlevel = 8)"
145+
"interpolated_map = gis.map(\"Tamil Nadu\")"
135146
]
136147
},
137148
{
@@ -140,7 +151,7 @@
140151
"metadata": {},
141152
"outputs": [],
142153
"source": [
143-
"interpolated_map.add_layer(interpolated_rf['result_layer'])"
154+
"interpolated_map.content.add(interpolated_rf['result_layer'])"
144155
]
145156
},
146157
{

0 commit comments

Comments
 (0)