Skip to content

Commit 1135e28

Browse files
committed
resolve conflicts from merging with master
2 parents 209f611 + 28e12fd commit 1135e28

File tree

73 files changed

+27214
-5295
lines changed

Some content is hidden

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

73 files changed

+27214
-5295
lines changed

docker/NotebookImage.Dockerfile

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
ARG python_version="3.11"
2-
FROM quay.io/jupyter/base-notebook:python-${python_version}
2+
FROM quay.io/jupyter/minimal-notebook:python-${python_version}
33

44
ARG python_version
5-
ARG arcgis_version="2.3.1"
5+
ARG arcgis_version="2.4.0"
66
ARG sampleslink="https://github.com/Esri/arcgis-python-api/releases/download/v${arcgis_version}/samples.zip"
77
ARG githubfolder="arcgis-python-api"
8-
ENV DOCKER_STACKS_JUPYTER_CMD="notebook"
8+
ARG env_name=arcgis
99

1010
LABEL org.opencontainers.image.authors="[email protected]"
11-
LABEL org.opencontainers.image.description="Jupyter Notebook with the latest version of the ArcGIS API for Python and its Linux dependencies preinstalled"
11+
LABEL org.opencontainers.image.description="Jupyter environment preconfigured for ArcGIS API for Python"
1212
LABEL org.opencontainers.image.licenses=Apache
1313
LABEL org.opencontainers.image.source=https://github.com/Esri/arcgis-python-api
1414

15-
USER root
16-
17-
RUN apt-get update --yes && \
18-
apt-get install --yes --no-install-recommends unzip && \
19-
apt-get clean && rm -rf /var/lib/apt/lists/*
20-
2115
USER ${NB_UID}
2216

2317
# Install Python API from Conda
24-
RUN conda install -c esri arcgis=${arcgis_version} -y \
18+
RUN conda create -n ${env_name} -c esri -c defaults arcgis=${arcgis_version} python=${python_version} -y --quiet --override-channels \
2519
&& conda clean --all -f -y \
2620
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
2721

22+
# Install arcgis-mapping if arcgis_version >= 2.4.0
23+
RUN (dpkg --compare-versions $arcgis_version ge 2.4.0 \
24+
&& conda install -n ${env_name} -c esri -c defaults arcgis-mapping -y --quiet --override-channels \
25+
&& conda clean --all -f -y \
26+
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +;) \
27+
|| echo "[INFO] Skipped installing arcgis-mapping for version $arcgis_version (>= 2.4.0 required for arcgis-mapping)"
28+
2829
# Fetch and extract samples from GitHub
2930
RUN mkdir /home/${NB_USER}/$githubfolder && \
3031
wget -O samples.zip $sampleslink \
@@ -36,7 +37,34 @@ RUN mkdir /home/${NB_USER}/$githubfolder && \
3637
work/ \
3738
talks/ \
3839
environment.yml\
40+
# remove .DS_Store and __MACOSX from home directory:
41+
&& find /home/${NB_USER} -name ".DS_Store" -delete \
42+
&& rm -rf /home/${NB_USER}/__MACOSX \
3943
&& fix-permissions /home/${NB_USER}
4044

41-
RUN rm /opt/conda/lib/python${python_version}/site-packages/notebook/static/base/images/logo.png
42-
COPY --chown=${NB_USER}:users jupyter_esri_logo.png /opt/conda/lib/python${python_version}/site-packages/notebook/static/base/images/logo.png
45+
# See https://jupyter-docker-stacks.readthedocs.io/en/latest/using/recipes.html#add-a-custom-conda-environment-and-jupyter-kernel
46+
# Create Python kernel and link it to jupyter
47+
RUN "${CONDA_DIR}/envs/${env_name}/bin/python" -m ipykernel install --user --name="${env_name}" && \
48+
fix-permissions "${CONDA_DIR}" && \
49+
fix-permissions "/home/${NB_USER}"
50+
51+
52+
# More information here: https://github.com/jupyter/docker-stacks/pull/2047
53+
USER root
54+
55+
# Set DOCKER_STACKS_JUPYTER_CMD to "notebook" for versions less than 2.4.0
56+
RUN \
57+
(dpkg --compare-versions $arcgis_version lt 2.4.0 \
58+
&& echo 'DOCKER_STACKS_JUPYTER_CMD="notebook"' >> /etc/environment \
59+
&& echo "[INFO] Set DOCKER_STACKS_JUPYTER_CMD to notebook for arcgis < 2.4.0") \
60+
|| echo "[INFO] Using default DOCKER_STACKS_JUPYTER_CMD (lab) for arcgis >= 2.4.0"
61+
62+
RUN \
63+
# This changes a startup hook, which will activate the custom environment for the process
64+
echo conda activate "${env_name}" >> /usr/local/bin/before-notebook.d/10activate-conda-env.sh && \
65+
# This makes the custom environment default in Jupyter Terminals for all users which might be created later
66+
echo conda activate "${env_name}" >> /etc/skel/.bashrc && \
67+
# This makes the custom environment default in Jupyter Terminals for already existing NB_USER
68+
echo conda activate "${env_name}" >> "/home/${NB_USER}/.bashrc"
69+
70+
USER ${NB_UID}

guide/01-getting-started/system-requirements.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"> Note: if `arcpy` is found in the current python environment, it may be used in various locations. Otherwise, `gdal` or `pyshp` will be used. See [Spatially Enabled DataFrame](https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=geoaccessor#arcgis.features.GeoAccessor) for more information.\n",
7979
"\n",
8080
"\n",
81+
"\n",
8182
"### Optional Dependencies\n",
8283
"\n",
8384
"There are some other python packages that may be required to use certain functionality in the API, but are __not__ automatically installed. To use that functionality, you must manually call `conda install {package_name}` or `pip install {package_name}` for such optional packages.\n",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"- `Swipe.edit` - deprecated in **2.4.0** removed in future major release. Use the `content` property setter instead.\n",
2929
"- `MapAction` - deprecated in **2.4.0** removed in future major release. Use the `MediaAction` class instead.\n",
3030
"- `JournalStoryMap` - deprecated in **2.0.0** removed in **2.4.0**. Template was removed from the ArcGIS platform.\n",
31+
"- `Hub.initiatives` - deprecated in **2.4.0** removed in a future release. Use `Hub.sites` instead.\n",
3132
"\n",
3233
"\n",
3334
"### `arcgis.learn` Module\n",
@@ -189,7 +190,7 @@
189190
"name": "python",
190191
"nbconvert_exporter": "python",
191192
"pygments_lexer": "ipython3",
192-
"version": "3.10.14"
193+
"version": "3.11.5"
193194
}
194195
},
195196
"nbformat": 4,

guide/02-api-overview/overview24.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
"Primary Python Support is for version 3.11. Secondary support is provided for Python 3.10 and 3.12. We have dropped Support for Python 3.9."
2121
]
2222
},
23+
{
24+
"cell_type": "markdown",
25+
"id": "ff163308-2526-4b3a-965b-5b430738c5f8",
26+
"metadata": {},
27+
"source": [
28+
"> **Note:** The ArcGIS API for Python 2.4.0 release is supported with:\n",
29+
"* ArcGIS Pro 3.4 and later cloned environments\n",
30+
"* ArcGIS Enterprise 11.4 and later\n",
31+
"* Stand-alone _conda_ and Python environments"
32+
]
33+
},
2334
{
2435
"cell_type": "markdown",
2536
"id": "3da4c48b-3c82-490f-9b76-d2063307b56c",
@@ -481,7 +492,7 @@
481492
"name": "python",
482493
"nbconvert_exporter": "python",
483494
"pygments_lexer": "ipython3",
484-
"version": "3.11.0"
495+
"version": "3.11.10"
485496
}
486497
},
487498
"nbformat": 4,

guide/02-api-overview/release_notes_240.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"source": [
88
"# What's new in version 2.4.0\n",
99
"\n",
10+
"> **Note:** The ArcGIS API for Python 2.4.0 release is supported with ArcGIS Pro 3.4 and later cloned environments for use with _arcpy_. The 2.4.0 _arcgis_ and _arcgis-mapping_ packages are incompatible with ArcGIS Pro 3.3.x and earlier cloned environments. The default ArcGIS Pro 3.3.x environment can be cloned and upgraded to _arcgis_ packages of 2.3.x.\n",
11+
"\n",
1012
"## New\n",
1113
"Reorganized modules and refactored functionality into new classes to incorporate the new Jupyter Lab and Notebook 7 architectures.\n",
1214
"* Deprecated modules:\n",
@@ -492,7 +494,7 @@
492494
"name": "python",
493495
"nbconvert_exporter": "python",
494496
"pygments_lexer": "ipython3",
495-
"version": "3.11.0"
497+
"version": "3.11.10"
496498
},
497499
"toc": {
498500
"base_numbering": 1,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@
14251425
"source": [
14261426
"## Creating new content\n",
14271427
"\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",
1428+
"To create new items on your GIS, use the [`add()`](https://developers.arcgis.com/python/latest/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",
14291429
"\n",
14301430
"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",
14311431
"\n",
@@ -1472,7 +1472,7 @@
14721472
},
14731473
{
14741474
"cell_type": "code",
1475-
"execution_count": 12,
1475+
"execution_count": null,
14761476
"metadata": {},
14771477
"outputs": [],
14781478
"source": [
@@ -1485,7 +1485,7 @@
14851485
"root_folder = gis.content.folders.get()\n",
14861486
"earthquake_csv_item = root_folder.add(\n",
14871487
" item_properties=csv_properties, \n",
1488-
" data=csv_path,\n",
1488+
" file=csv_path,\n",
14891489
" thumbnail = thumbnail_path\n",
14901490
").result()"
14911491
]
@@ -2332,7 +2332,7 @@
23322332
"source": [
23332333
"**Note**: here, we used the `add()` method to add the `FeatureCollection` object in memory as an item on the GIS. Notice we used the `text` property to pass the JSON representation of the feature collection and the `type` property to indicate the item type. You can use the same method to publish web maps and web scenes.\n",
23342334
"\n",
2335-
"The [sample notebooks for content publishers](https://developers.arcgis.com/python/sample-notebooks/publishing-web-maps-and-web-scenes/) show how the concepts discussed here can be used to publish web maps and scenes to your GIS"
2335+
"The [sample notebooks for content publishers](/python/latest/samples/publishing-web-maps-and-web-scenes/) show how the concepts discussed here can be used to publish web maps and scenes to your GIS"
23362336
]
23372337
},
23382338
{
@@ -2582,7 +2582,7 @@
25822582
"name": "python",
25832583
"nbconvert_exporter": "python",
25842584
"pygments_lexer": "ipython3",
2585-
"version": "3.11.0"
2585+
"version": "3.11.11"
25862586
},
25872587
"toc": {
25882588
"base_numbering": 1,

guide/03-the-gis/cloning-content.ipynb

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,28 +1388,14 @@
13881388
"cell_type": "markdown",
13891389
"metadata": {},
13901390
"source": [
1391-
"### ArcGIS Dashboards"
1391+
"### ArcGIS Dashboards and ArcGIS StoryMaps"
13921392
]
13931393
},
13941394
{
13951395
"cell_type": "markdown",
13961396
"metadata": {},
13971397
"source": [
1398-
"See the [Cloning and Troubleshooting Complex Items](../cloning-complex-apps#dashboards-and-editing-item-data) guide for details on cloning ArcGIS Dashboards. "
1399-
]
1400-
},
1401-
{
1402-
"cell_type": "markdown",
1403-
"metadata": {},
1404-
"source": [
1405-
"### Story Maps"
1406-
]
1407-
},
1408-
{
1409-
"cell_type": "markdown",
1410-
"metadata": {},
1411-
"source": [
1412-
"See the [Cloning and Troubleshooting Complex Items](../cloning-complex-apps/#storymaps-web-scenes-and-item-remapping) guide for details on cloning ArcGIS StoryMaps. "
1398+
"See the [Cloning and Troubleshooting Complex Items](../cloning-complex-apps#dashboards-and-editing-item-data) guide for details on cloning ArcGIS Dashboards and ArcGIS StoryMaps. "
14131399
]
14141400
},
14151401
{
@@ -1438,7 +1424,7 @@
14381424
"name": "python",
14391425
"nbconvert_exporter": "python",
14401426
"pygments_lexer": "ipython3",
1441-
"version": "3.9.17"
1427+
"version": "3.11.10"
14421428
},
14431429
"toc": {
14441430
"base_numbering": 1,
@@ -1455,5 +1441,5 @@
14551441
}
14561442
},
14571443
"nbformat": 4,
1458-
"nbformat_minor": 2
1444+
"nbformat_minor": 4
14591445
}

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

Lines changed: 2126 additions & 1 deletion
Large diffs are not rendered by default.

guide/04-feature-data-and-analysis/appending-features.ipynb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
"source": [
1414
"Any Web GIS Administrator can attest to the fundamental importance of managing hosted feature layers in ArcGIS online. Traditionally, adding data en masse to existing hosted feature layers typically involved a three-step process of downloading the feature layer data, merging additional edits, and finally overwriting the original feature layer. While that workflow still suffices in many circumstances, the [`append()`](https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureLayer.append) function greatly simplifies the process. It can save you a ton of time if your features layers are large, eliminating the time involved in overwriting the feature layer. \n",
1515
"\n",
16-
"Let's take a look at some example `append()` workflows below. This guide document refers to the feature layer you will append data into as the `target`, while the item you append data from is referred to as the `source`."
16+
"Let's take a look at some example `append()` workflows below. This guide document refers to the feature layer you will append data into as the `target`, while the item you append data from is referred to as the `source`.\n",
17+
"\n",
18+
"> **Note:** Please see the [Append (Feature Service/Layer)](https://developers.arcgis.com/rest/services-reference/enterprise/append-feature-service-layer/) for technical reference details on the append operation.\n",
19+
"\n",
20+
"> **Note:** When appending features from files, important criteria must be met in order for the append to succeed, and only certain file formats may be supported for a given layer. Please see the documentation for your deployment before attempting to append data:\n",
21+
"> * ArcGIS Online: _Manage hosted feature layers_ - [Add and update features from a file](https://doc.arcgis.com/en/arcgis-online/manage-data/manage-hosted-feature-layers.htm#APPEND)\n",
22+
"> * ArcGIS Enteprise: _Manage hosted feature layers_ - [Add and update features from a file](https://enterprise.arcgis.com/en/portal/latest/use/manage-hosted-feature-layers.htm#APPEND)"
1723
]
1824
},
1925
{
@@ -118,7 +124,7 @@
118124
"source": [
119125
"## Append New Features from a File Geodatabase\n",
120126
"\n",
121-
"This first example appends new features from a File Geodatabase into a hosted feature layer. For optimal performance and minimal chance of errors when using [`append()`](https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureLayer.append), Esri strongly recommends the schema for the source file to upload (source) matches the schema of the hosted feature service layer (target). \n",
127+
"This first example appends new features from a File Geodatabase into a hosted feature layer. For optimal performance and minimal chance of errors when using [`append()`](https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureLayer.append), Esri strongly recommends the schema for the source file to upload (source) matches the schema of the hosted feature service layer (target). Please note that appending from a file geodatabase is only supported in ArcGIS Online.\n",
122128
"\n",
123129
"In this first section, you'll have matching schema between your File Geodatabase item (named `SubDiv_PB11_PG48_parcels`) and a hosted feature service layer you will publish."
124130
]
@@ -414,7 +420,11 @@
414420
"metadata": {},
415421
"source": [
416422
"### Get the source item for appending\n",
417-
"In order for the append workflow to succeed, you need to add the source file containing the new features as an Item in your GIS. In this case, the data file is already uploaded as an Item for you. From there, get the item id value for this file geodatabase item containing features you want to append to the feature layer. In this case, the Schema from the file geodatabase you'll append matches that of the hosted feature layer."
423+
"In order for the append workflow to succeed, you need to add the source file containing the new features as an Item in your GIS. In this case, the data file is already uploaded as an Item for you. From there, get the item id value for this file geodatabase item containing features you want to append to the feature layer. In this case, the Schema from the file geodatabase you'll append matches that of the hosted feature layer.\n",
424+
"\n",
425+
"> **Note:** It is important to verify the Feature Layer you use supports the operation you intend to run. Please query the feature layer for the following properties to confirm:\n",
426+
"> * `FeatureLayer.properties.supportsAppend` - see [Supports append](https://developers.arcgis.com/rest/services-reference/enterprise/append-feature-service-layer/#supports-append) for details.\n",
427+
"> * `FeatureLayer.properties.supportedAppendFormats` - see [Supported append formats](https://developers.arcgis.com/rest/services-reference/enterprise/append-feature-service-layer/#supported-append-formats) for details."
418428
]
419429
},
420430
{
@@ -546,7 +556,6 @@
546556
"source": [
547557
"m2 = gis.map(\"Downingtown, PA\")\n",
548558
"m2.center = [40.0065, -75.7033]\n",
549-
"m2.zoom = 14\n",
550559
"m2"
551560
]
552561
},

guide/04-feature-data-and-analysis/editing-features.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
],
9999
"source": [
100100
"# access the item's feature layers\n",
101-
"ports_layer = portal_item.layers[0]\n",
102-
"ports_layer"
101+
"ports_flayer = portal_item.layers[0]\n",
102+
"ports_flayer"
103103
]
104104
},
105105
{
@@ -118,7 +118,7 @@
118118
"source": [
119119
"# query all the features and display it on a map\n",
120120
"# an empty query string will return all features or the first 1000, whichever is smaller\n",
121-
"ports_fset = ports_layer.query()"
121+
"ports_fset = ports_flayer.query()"
122122
]
123123
},
124124
{
@@ -658,7 +658,7 @@
658658
}
659659
],
660660
"source": [
661-
"ports_layer.properties.capabilities"
661+
"ports_flayer.properties.capabilities"
662662
]
663663
},
664664
{

0 commit comments

Comments
 (0)