Skip to content

Commit d1c3ba7

Browse files
author
Manushi Majumdar
committed
Merge branch 'master' of https://github.com/ManushiM/arcgis-python-api into master
2 parents e489f03 + e65c474 commit d1c3ba7

26 files changed

+7789
-89
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: DockerBuild.LambdaImage
2+
3+
on:
4+
# allow it to be run on-demand
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-and-push:
9+
name: Build Docker image and push to ghcr.io
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Docker Buildx
17+
id: buildx
18+
uses: docker/setup-buildx-action@v2
19+
20+
- name: Login to Github Packages
21+
uses: docker/login-action@v2
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Docker meta
28+
id: meta
29+
uses: docker/metadata-action@v4
30+
with:
31+
images: |
32+
ghcr.io/esri/arcgis-python-api-lambda
33+
tags: |
34+
type=raw,value=2.1.0,enable={{is_default_branch}}
35+
type=raw,value=latest,enable={{is_default_branch}}
36+
type=schedule,pattern={{date 'YY.MM'}},enable={{is_default_branch}}
37+
type=sha,format=long
38+
39+
- id: docker_build
40+
name: Build image and push to GitHub Container Registry
41+
uses: docker/build-push-action@v4
42+
with:
43+
# relative path to the place where source code with Dockerfile is located
44+
context: .
45+
file: ./docker/LambdaBaseImage.Dockerfile
46+
tags: ${{ steps.meta.outputs.tags }}
47+
provenance: false
48+
platforms: linux/amd64
49+
push: true

docker/LambdaBaseImage.Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ARG PYTHON_VERSION=3.9
2+
# lambda python image, defaults to python 3.9
3+
FROM public.ecr.aws/lambda/python:${PYTHON_VERSION}
4+
5+
# set metadata
6+
LABEL org.opencontainers.image.authors="[email protected]"
7+
LABEL org.opencontainers.image.description="AWS Lambda image with arcgis Python API and its Linux dependencies preinstalled"
8+
LABEL org.opencontainers.image.licenses=Apache
9+
LABEL org.opencontainers.image.source=https://github.com/esri/arcgis-python-api
10+
11+
# install dependencies, then clean yum cache
12+
RUN yum -y install gcc krb5-devel krb5-server krb5-libs && yum clean all && rm -rf /var/cache/yum
13+
# install arcgis
14+
ARG ARCGIS_PYTHON_VERSION=2.1.0.3
15+
RUN pip3 install arcgis==${ARCGIS_PYTHON_VERSION} --target "${LAMBDA_TASK_ROOT}"
16+
# set entrypoint to app.py handler method
17+
# (note that app.py is missing from this base image)
18+
CMD [ "app.handler" ]
19+
# to use this base image, use FROM to specify its url
20+
# and `COPY app.py ${LAMBDA_TASK_ROOT}`
21+
# (copy your code into the lambda task root)

docker/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# docker
2+
3+
Some useful docker images for utilizing the ArcGIS API for Python in your workflows
4+
5+
## LambdaBaseImage
6+
7+
#### ghcr.io/esri/arcgis-python-api-lambda:latest
8+
9+
To use this image, setup your dockerfile like:
10+
```
11+
FROM ghcr.io/esri/arcgis-python-api-lambda
12+
COPY app.py ${LAMBDA_TASK_ROOT}
13+
```
14+
15+
your app.py should have a handler method:
16+
```
17+
import arcgis
18+
19+
def handler(event, context):
20+
"""
21+
AWS Lambda Handler
22+
"""
23+
print(f"Hello from AWS Lambda using ArcGIS API for Python {arcgis.__version__}!")
24+
```
25+
26+
Push to your _private_ AWS ECR instance, and configure lambda to run from this container image. As of this writing, public AWS ECR instances are not supported for lambda.

guide/01-getting-started/install-and-set-up.ipynb

Lines changed: 71 additions & 51 deletions
Large diffs are not rendered by default.

guide/01-getting-started/install-older-versions.ipynb

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

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"metadata": {},
2323
"source": [
2424
"## Operating System \n",
25-
"The ArcGIS API for Python is compatible with 32-bit and 64-bit versions of Windows, macOS, and Linux.\n",
25+
"The ArcGIS API for Python 2.1.0 is compatible with 64-bit versions of Windows, macOS, and Linux. Note that, 32-bit versions of Windows and Linux is no longer supported for API versioned later than 1.7.1.\n",
2626
"\n",
2727
"## Python Version\n",
28-
"Python 3.5 or later is required to use the ArcGIS API for Python.\n",
28+
"Python 3.7.0 to 3.9.x is required to use the ArcGIS API for Python 2.1.0.\n",
2929
"\n",
3030
"## Dependencies\n",
3131
"The full power of the ArcGIS API for Python is best experienced when all its dependencies are installed. However, specific tasks such as GIS administration and content management can be accomplished with a subset of dependencies installed. See [Install with minimum Dependencies](../install-and-set-up#install-with-minimum-dependencies) to install the `arcgis` package in this manner.\n",
@@ -71,7 +71,7 @@
7171
],
7272
"metadata": {
7373
"kernelspec": {
74-
"display_name": "Python 3 (ipykernel)",
74+
"display_name": "Python 3",
7575
"language": "python",
7676
"name": "python3"
7777
},
@@ -85,7 +85,7 @@
8585
"name": "python",
8686
"nbconvert_exporter": "python",
8787
"pygments_lexer": "ipython3",
88-
"version": "3.7.11"
88+
"version": "3.7.10"
8989
},
9090
"toc": {
9191
"base_numbering": 1,

guide/01-getting-started/understanding-conda.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
"\n",
7777
" * [Python and ArcGIS Pro 1.3: Conda](https://community.esri.com/docs/DOC-8359)\n",
7878
" * [Conda and ArcGIS Pro 1.4](https://arcpy.wordpress.com/2016/10/21/conda-and-arcgis-pro/)\n",
79+
" * [ArcGIS Notebooks in ArcGIS Pro (2.9) FAQ](https://community.esri.com/t5/python-documents/arcgis-notebooks-in-arcgis-pro-2-9-faq/ta-p/1116141)\n",
80+
" * [ArcGIS Notebooks in ArcGIS Pro (3.0) FAQ](https://community.esri.com/t5/python-documents/arcgis-notebooks-in-arcgis-pro-3-0-faq/ta-p/1196582)\n",
7981
"\n",
8082
"### Anaconda Distribution\n",
8183
"After the installation, Anaconda installs Python, conda, and hundreds of default packages into one environment:\n",
@@ -200,7 +202,7 @@
200202
"metadata": {
201203
"anaconda-cloud": {},
202204
"kernelspec": {
203-
"display_name": "Python 3 (ipykernel)",
205+
"display_name": "Python 3",
204206
"language": "python",
205207
"name": "python3"
206208
},
@@ -214,7 +216,7 @@
214216
"name": "python",
215217
"nbconvert_exporter": "python",
216218
"pygments_lexer": "ipython3",
217-
"version": "3.7.11"
219+
"version": "3.7.10"
218220
},
219221
"toc": {
220222
"base_numbering": 1,

guide/02-api-overview/release_notes_210.ipynb

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,73 @@
55
"id": "26414291",
66
"metadata": {},
77
"source": [
8+
"# Patch Release 2.1.0.3\n",
9+
"#### [`arcgis.gis`](/python/api-reference/arcgis.gis.toc.html)\n",
10+
"* [`GIS`](/python/api-reference/arcgis.gis.toc.html#gis)\n",
11+
" * Improve parsing support for users with Kerberors and IWA authentication schemes\n",
12+
"\n",
13+
"#### [`arcgis.gis.admin`](/python/api-reference/arcgis.gis.admin.html#)\n",
14+
"* [`AGOLUsageReports`](/python/api-reference/arcgis.gis.admin.html#arcgis.gis.admin.AGOLUsageReports)\n",
15+
" * Fixes issue with incorrect statistics for date ranges over 5 months ago\n",
16+
"\n",
17+
"#### [`arcgis.gis.server`](/python/api-reference/arcgis.gis.server.html#)\n",
18+
"* [`LogManager`](/python/api-reference/arcgis.gis.server.html#logmanager)\n",
19+
" * [`query()`](/python/api-reference/arcgis.gis.server.html#arcgis.gis.server.LogManager.query)\n",
20+
" * Fixes BUG-000154142 where paging was not terminating propertly with record amounts over 5000\n",
21+
"\n",
22+
"#### [`arcgis.features`](/python/api-reference/arcgis.features.toc.html)\n",
23+
"* [`FeatureLayerCollection`](/python/api-reference/arcgis.features.toc.html#featurelayercollection)\n",
24+
" * [`extract_changes()`]()\n",
25+
" * Adds `layer_servergen` parameter and documentation\n",
26+
"\n",
27+
"#### [`arcgis.geometry`](/python/api-reference/arcgis.geometry.html)\n",
28+
"* [`Geometry`](/python/api-reference/arcgis.geometry.html#geometry)\n",
29+
" * [`true_centroid`](/python/api-reference/arcgis.geometry.html#arcgis.geometry.Geometry.true_centroid)\n",
30+
" * Ensures property returns results as a `geometry` object instead of tuple\n",
31+
"\n",
32+
"#### [`arcgis.geoenrichment`](/python/api-reference/arcgis.geoenrichment.html)\n",
33+
"* Fixes issue for parsing with multiple buffer distances\n",
34+
"\n",
35+
"#### [`arcgis.graph`](/python/api-reference/arcgis.graph.html)\n",
36+
"* [`KnowledgeGraph`](/python/api-reference/arcgis.graph.html#knowledgegraph)\n",
37+
" * Adds [`apply_edits()`](/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.query) method to support editing\n",
38+
"\n",
39+
"#### [`arcgis.apps`](/python/api-reference/arcgis.apps.html)\n",
40+
"* [`hub`](/python/api-reference/arcgis.apps.hub.html)\n",
41+
" * Fixes issue with token handling for security purposes\n",
42+
" * Fixes issue with properly reading sharing properties\n",
43+
" * [`Page`]()\n",
44+
" * [`update_layout()`](/python/api-reference/arcgis.apps.hub.html#arcgis.apps.hub.sites.Page.update_layout)\n",
45+
" * Fixes issue to ensure works properly with new backend infrastructure implementation\n",
46+
"* [`storymap`](/python/api-reference/arcgis.apps.storymap.html)\n",
47+
" * [`Timeline`](/python/api-reference/arcgis.apps.storymap.html#timeline)\n",
48+
" * Fixes issue where position of node was not properly returned\n",
49+
"\n",
50+
"#### [`arcgis.learn`](/python/api-reference/arcgis.learn.toc.html)\n",
51+
"* Updates prediction output formatting to `x,y,w,h`\n",
52+
"* Fixes intermittent erratic `one_cycle` behavior and uses default `learning_rate` when `lr=None`\n",
53+
"* Fixes Class dump format in a generated `emd`\n",
54+
"* Fixes `average_precision_score_output` formatting\n",
55+
"* Adds explicit documentation for data formatting\n",
56+
"\n",
57+
"# Patch Release 2.1.0.2\n",
58+
"#### [`arcgis.learn`](/python/api-reference/arcgis.learn.toc.html)\n",
59+
"* Restores functionality of internal inferencing checks\n",
60+
"\n",
61+
"# Patch Release 2.1.0.1\n",
62+
"#### [`arcgis.features`](/python/api-reference/arcgis.features.toc.html)\n",
63+
" * [`FeatureLayerCollection`](/python/api-reference/arcgis.features.toc.html#featurelayercollection)\n",
64+
" * [`extract_changes()`](/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureLayerCollection.extract_changes)\n",
65+
" * Adds support for querying the last time changes were sent on each layer \n",
66+
"\n",
67+
"#### [`arcgis.features.managers`](/python/api-reference/arcgis.features.managers.html#)\n",
68+
" * [`Version`](/python/api-reference/arcgis.features.managers.html#version)\n",
69+
" * [`edit()`](/python/api-reference/arcgis.features.managers.html#arcgis.features._version.Version.edit)\n",
70+
" * Updates support for Enterprise 11.1\n",
71+
" \n",
872
"# What's new in version 2.1.0\n",
73+
"* **Note:** Installation of the API for Python results in version number `2.1.0.2`\n",
74+
"\n",
975
"\n",
1076
"## New\n",
1177
"* Adds [Dask](https://www.dask.org/) Support\n",

guide/06-imagery-and-raster-analysis/raster-analysis-advanced-concepts.ipynb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"source": [
3535
"## Access Landsat imagery\n",
3636
"\n",
37-
"We've added an multispectral imagery layer item to our organization from ArcGIS Online that we'll use for this tutorial. Let's connect and get the specific item by it's ID value in our organization:"
37+
"We've added a multispectral imagery layer item to our organization from ArcGIS Online that we'll use for this tutorial. Let's connect and get the specific item by its ID value in our organization:"
3838
]
3939
},
4040
{
@@ -140,7 +140,7 @@
140140
"metadata": {},
141141
"source": [
142142
"### Access the layers available with the Landsat Imagery Layer item\n",
143-
"This imagery layer item contains the imagery layer that we'll be using for this tutorial. Let's save a reference to the layer in the `landsat` variable. Querying the variable will in the Jupyter notebook will quickly render it as an image"
143+
"This imagery layer item contains the imagery layer that we'll be using for this tutorial. Let's save a reference to the layer in the `landsat` variable. Querying the variable in Jupyter Notebook will quickly render it as an image."
144144
]
145145
},
146146
{
@@ -353,7 +353,7 @@
353353
"source": [
354354
"## Apply built-in raster functions\n",
355355
"\n",
356-
"The multispectral imagery layer can be rendered using several different raster functions (also known as raster function templates). Each raster function template incorporates different satellite bands to highlight different land cover features. Obtain list of predefined raster function templates defined by the service backing the imagery layer:"
356+
"The multispectral imagery layer can be rendered using several different raster functions (also known as raster function templates). Each raster function template incorporates different satellite bands to highlight different land cover features. Obtain a list of predefined raster function templates defined by the service backing the imagery layer:"
357357
]
358358
},
359359
{
@@ -398,7 +398,7 @@
398398
"cell_type": "markdown",
399399
"metadata": {},
400400
"source": [
401-
"Let's apply the 'Color Infrared with DRA' raster function to visualize the color infrared view. This can be done using the `apply` function in the `arcgis.raster.functions` module. This function applies a server defined raster function template, given it's name, to the Imagery layer."
401+
"Let's apply the 'Color Infrared with DRA' raster function to visualize the color infrared view. This can be done using the `apply` function in the `arcgis.raster.functions` module. This function applies a server-defined raster function template, given its name, to the Imagery layer."
402402
]
403403
},
404404
{
@@ -447,7 +447,7 @@
447447
"cell_type": "markdown",
448448
"metadata": {},
449449
"source": [
450-
"A **true-color image** uses red, green and blue satellite bands to create an image that looks like a photograph. The **color infrared** view, on the other hand, uses the near infrared, red and green satellite bands to create an image. As a result, vegetation appears bright red in the image above."
450+
"A **true-color image** uses red, green, and blue satellite bands to create an image that looks like a photograph. The **color infrared** view, on the other hand, uses the near infrared, red and green satellite bands to create an image. As a result, vegetation appears bright red in the image above."
451451
]
452452
},
453453
{
@@ -491,7 +491,7 @@
491491
"source": [
492492
"### Setting an area of interest\n",
493493
"\n",
494-
"When working with Imagery layers, you are typically working in an area of interest. You can set the extent of the Imagery layer to that area of interest, and query it to visualize the imagery layer with that extent within the notebook:"
494+
"When working with Imagery layers, you are typically working in an area of interest. You can set the extent of the Imagery layer to that area of interest and query it to visualize the imagery layer to that extent within the notebook:"
495495
]
496496
},
497497
{
@@ -538,7 +538,7 @@
538538
"cell_type": "markdown",
539539
"metadata": {},
540540
"source": [
541-
"Since we will be using the landsat layer further down in this notebook, let's set it's extent to our area of extent as well:"
541+
"Since we will be using the landsat layer further down in this notebook, let's set its extent to our area of extent as well:"
542542
]
543543
},
544544
{
@@ -569,7 +569,7 @@
569569
"source": [
570570
"## Exporting Images from Imagery Layer\n",
571571
"\n",
572-
"In addition to visualizing the imagery layers in the Jupyter Notebook, or using a map widge, they can be exported using the `export_image` method provided by ImageryLayers:"
572+
"In addition to visualizing the imagery layers in Jupyter Notebook, or using a map widget, they can be exported using the `export_image` method provided by ImageryLayers:"
573573
]
574574
},
575575
{
@@ -778,9 +778,9 @@
778778
"source": [
779779
"## Custom Bands\n",
780780
"\n",
781-
"You can also create your own indexes and band combinations, as well as specify stretch and gamma values to adjust the image contrast.\n",
781+
"You can also create your own indexes and band combinations and specify stretch and gamma values to adjust the image contrast.\n",
782782
"\n",
783-
"The code below first extracts the [3 (Red), 2 (Green), 1 (Blue)] bands using the `extract_bands` function and passes it's output to the `stretch` function to enhance the image:"
783+
"The code below first extracts the [3 (Red), 2 (Green), 1 (Blue)] bands using the `extract_bands` function and passes its output to the `stretch` function to enhance the image:"
784784
]
785785
},
786786
{
@@ -827,7 +827,7 @@
827827
"cell_type": "markdown",
828828
"metadata": {},
829829
"source": [
830-
"This is a true-color image (similar to a photograph), created using the red, green, and blue satellite bands. Notice how much easier it was to find healthy vegetation using the NDVI vegetation index, compared to the true-color image here."
830+
"This is a true-color image (similar to a photograph) created using the red, green, and blue satellite bands. Notice how much easier it was to find healthy vegetation using the NDVI vegetation index compared to the true-color image."
831831
]
832832
},
833833
{
@@ -1425,7 +1425,7 @@
14251425
"cell_type": "markdown",
14261426
"metadata": {},
14271427
"source": [
1428-
"Equivalently we can use a constant `Enum`, e.g. `LengthUnits.METER`, or the integer `9001` to specify the same requirement.\n",
1428+
"Equivalently we can use a constant `Enum`, e.g., `LengthUnits.METER`, or the integer `9001`, to specify the same requirement.\n",
14291429
"\n",
14301430
"```\n",
14311431
"from arcgis.geometry import LengthUnits\n",
@@ -1519,7 +1519,7 @@
15191519
"collapsed": true
15201520
},
15211521
"source": [
1522-
"You can select images by attributes using a where clause as well as using spatial and temporal filters, using the `filter_by` method.\n",
1522+
"You can select images by attributes using a where clause as well as using spatial and temporal filters using the `filter_by` method.\n",
15231523
"\n",
15241524
"The code snippet below limits the images available to those that have less than 10% cloud cover and which intersect with our area of interest:"
15251525
]
@@ -1769,7 +1769,7 @@
17691769
"\n",
17701770
"When a set of rasters are selected by filtering an Imagery layer, they may have overlapping pixels.\n",
17711771
"\n",
1772-
"The Imagery layer has methods like first(), last(), min(), max(), mean(), blend() and sum() to resolve overlap pixel values from first or last raster, use the min, max or mean of the pixel values, or blend them:"
1772+
"The Imagery layer has methods like first(), last(), min(), max(), mean(), blend(), and sum() to resolve overlap pixel values from the first or last raster, use the min, max or mean of the pixel values, or blend them:"
17731773
]
17741774
},
17751775
{
@@ -1867,9 +1867,9 @@
18671867
"source": [
18681868
"## Difference Image\n",
18691869
"\n",
1870-
"Difference Image mode illustrates all the changes in NDVI (vegeration index) between the two dates:\n",
1870+
"Difference Image mode illustrates all the changes in NDVI (vegetation index) between the two dates:\n",
18711871
"\n",
1872-
"increases are shown in green, and decreases are shown in magenta. "
1872+
"Increases are shown in green, and decreases are shown in magenta. "
18731873
]
18741874
},
18751875
{
@@ -2047,10 +2047,10 @@
20472047
"source": [
20482048
"### Persisting your analysis for visualization or analysis\n",
20492049
"\n",
2050-
"The `save()` method on ImageryLayer class persists this imagery layer to the GIS as an Imagery Layer item. If `for_viz` parameter is True, a new Item is created that uses the applied raster functions for visualization at display resolution using on-the-fly image processing. If `for_viz` is False, distributed raster analysis is used for generating a new raster information product by applying raster functions at source resolution across the extent of the output imagery layer.\n",
2050+
"The `save()` method on ImageryLayer class persists this imagery layer to the GIS as an Imagery Layer item. If the `for_viz` parameter is True, a new Item is created that uses the applied raster functions for visualization at display resolution using on-the-fly image processing. If `for_viz` is False, distributed raster analysis is used for generating a new raster information product by applying raster functions at source resolution across the extent of the output imagery layer.\n",
20512051
"\n",
20522052
"\n",
2053-
"In the example below, the threshold mask is being saved as item for visualization:"
2053+
"In the example below, the threshold mask is being saved as an item for visualization:"
20542054
]
20552055
},
20562056
{

guide/14-deep-learning/using-mmsegmentation-with-arcgis-learn.ipynb

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

0 commit comments

Comments
 (0)