Skip to content

Commit c5c80e8

Browse files
committed
removed markdown from create data notebook.
1 parent b9c6448 commit c5c80e8

File tree

2 files changed

+9
-103
lines changed

2 files changed

+9
-103
lines changed

labs/create_data.ipynb

Lines changed: 2 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,5 @@
11
{
22
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"metadata": {},
6-
"source": [
7-
"## Overview\n",
8-
"\n",
9-
"**You will learn:** a fast and easy way to use your Developer Subscription content manager and the [ArcGIS API for Python](https://developers.arcgis.com/python/guide/) to create a data schema in the cloud and populate features for use in your apps.\n",
10-
"\n",
11-
"With your [ArcGIS Developer Subscription](https://developers.arcgis.com/pricing/), you can use the [**Create Layer Dev Lab**](https://developers.arcgis.com/labs/data/create-a-new-dataset/) to learn how to create a new empty layer in your account. You can then use the [ArcGIS API for Python](https://developers.arcgis.com/python/) to easily populate the layer with actual features and attributes. \n",
12-
"\n",
13-
"The **Create Layer** tool lets you interactively define the name, feature type (points, lines or polygons), and attribute fields for a layer, and then save it to the cloud (ArcGIS Online). This process is called [publishing a hosted feature layer](https://doc.arcgis.com/en/arcgis-online/share-maps/publish-features.htm). Behind every feature layer is a [REST feature service](https://resources.arcgis.com/en/help/arcgis-rest-api/#/Feature_Service/02r3000000z2000000/), and the ArcGIS Platform provides many tools to populate this layer with data. The [features module](http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.toc.html) and [geometry module](http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geometry.html) in the ArcGIS API for Python can be used with the [map widget](http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html) to interactively edit a feature layer by adding new features. Once created and populated, your apps can access this service to query, draw or edit the data.\n",
14-
"\n",
15-
"In this lab you will create a new point dataset (feature layer) with the Create Layer tool and store it in your own developer [ArcGIS Online](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) account. You'll then use the ArcGIS API for Python to add features into the new layer. The lab will create points near Los Angeles, CA.\n",
16-
"\n",
17-
"You will run this lab in a [Jupyter Notebook](/python/guide/using-the-jupyter-notebook-environment/) IDE that is hosted by Esri. Notebooks created here are temporary, hence you must download them if you want to preserve them for later. However, you can [install the ArcGIS API for Python](/python/guide/install-and-set-up/) locally on your computer and run this lab from it, in which case, the notebooks are stored locally on your machine."
18-
]
19-
},
20-
{
21-
"cell_type": "markdown",
22-
"metadata": {},
23-
"source": [
24-
"## Steps\n",
25-
"#### Create a connection to your Developer Subscription account\n",
26-
"\n",
27-
"Log into ArcGIS Online by making a GIS connection to ArcGIS Online using your developer account. Replace `username` and `password` with the credentials to your ArcGIS Developer account. \n",
28-
" \n",
29-
"It is not good security practice to leave account credentials in source code shared by others, but it is beyond the scope of this lab to go over security best practices. The [getpass module](https://pymotw.com/2/getpass/) for Python provides an easy way to hide passwords in shared code.\n",
30-
"\n",
31-
"You can use a print statement with some gis properties to verify sign-in."
32-
]
33-
},
343
{
354
"cell_type": "code",
365
"execution_count": null,
@@ -48,19 +17,6 @@
4817
" dev_gis.users.me.username))"
4918
]
5019
},
51-
{
52-
"cell_type": "markdown",
53-
"metadata": {},
54-
"source": [
55-
"#### Search for the empty feature layer\n",
56-
"\n",
57-
"You can use the ArcGIS API for Python [Helper Objects](https://developers.arcgis.com/python/guide/using-the-GIS/#Helper-objects) to manage GIS resources. One such helper object is the [Content Manager](http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#contentmanager). You use its [search method](https://developers.arcgis.com/python/guide/accessing-and-creating-your-content/#Searching-for-content) to retrieve items from your GIS. The ArcGIS API for Python Guide also documents the process of [searching your gis for feature layers](https://developers.arcgis.com/python/guide/working-with-feature-layers-and-features/#Searching-the-GIS-for-feature-layers).\n",
58-
"\n",
59-
"The ArcGIS API for Python is a front end to the [ArcGIS REST API](https://developers.arcgis.com/documentation/core-concepts/rest-api/). The full [search reference](http://resources.arcgis.com/en/help/arcgis-rest-api/#/Search_reference/02r3000000mn000000/) documentation details how to search for items, including proper use of wildcards for characters and phrases. You'll use a wildcard to search for the empty feature layer created in the first portion of this lab (Steps 1-8).\n",
60-
"\n",
61-
"The `search()` method returns a list of `Item` objects that match the search criteria. "
62-
]
63-
},
6420
{
6521
"cell_type": "code",
6622
"execution_count": null,
@@ -75,15 +31,6 @@
7531
"flyr_search_results"
7632
]
7733
},
78-
{
79-
"cell_type": "markdown",
80-
"metadata": {},
81-
"source": [
82-
"#### Retrieve the feature layer object from the search results\n",
83-
"\n",
84-
"Since the search returns a list, you'll use Python [indexing](https://docs.python.org/3/tutorial/introduction.html#lists) to retrieve the object you want. In this case, the item returned is a feature layer collection item, so you'll need to obtain the list of layers in the collection and use indexing to access the layer you want."
85-
]
86-
},
8734
{
8835
"cell_type": "code",
8936
"execution_count": null,
@@ -98,17 +45,6 @@
9845
"flayer.properties.name"
9946
]
10047
},
101-
{
102-
"cell_type": "markdown",
103-
"metadata": {},
104-
"source": [
105-
"#### Define a function to serve as the event listener for the map widget on_click event\n",
106-
"\n",
107-
"You'll use a Python function to add fetures to the feature layer for locations you click on the map. Further illustrations of concepts and operations are available at [using the geometry service and geometry functions](https://developers.arcgis.com/python/sample-notebooks/using-geometry-functions/) in the [ArcGIS API for Python Guide](https://developers.arcgis.com/python/guide/). The API Reference documents the map widget [draw method](http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html#arcgis.widgets.MapView.draw) that you'll use to initially place graphic markers at the locations where you'll add features to the layer.\n",
108-
"\n",
109-
"The function creates a feature from the location clicked on the map. The **`OBJECTID`** attribute **MUST** be included in the attributes dictionary parameter to create a valid feature. You can also add additional attributes from the layer schema if desired."
110-
]
111-
},
11248
{
11349
"cell_type": "code",
11450
"execution_count": null,
@@ -133,13 +69,6 @@
13369
" print(\"Couldn't create the feature. Try again, please...\")"
13470
]
13571
},
136-
{
137-
"cell_type": "markdown",
138-
"metadata": {},
139-
"source": [
140-
"#### Assign a map object to a variable. Center the map in Los Angeles with a zoom level of your choice."
141-
]
142-
},
14372
{
14473
"cell_type": "code",
14574
"execution_count": null,
@@ -152,15 +81,6 @@
15281
"map1"
15382
]
15483
},
155-
{
156-
"cell_type": "markdown",
157-
"metadata": {},
158-
"source": [
159-
"#### Execute the on_click event to begin adding locations to the map\n",
160-
"\n",
161-
"Use the function you defined above as the callback parameter for the map widget [on_click](http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html#arcgis.widgets.MapView.on_click) event. Click on the map to draw a graphic marker for each feature you want to add to the layer. The callback also outputs a string representation of the geometry."
162-
]
163-
},
16484
{
16585
"cell_type": "code",
16686
"execution_count": null,
@@ -172,15 +92,6 @@
17292
"map1.on_click(create_feature)"
17393
]
17494
},
175-
{
176-
"cell_type": "markdown",
177-
"metadata": {},
178-
"source": [
179-
"#### Clear the graphic markers from the map\n",
180-
"\n",
181-
"You'll clear the graphics so you can subsequently add the layer to the map to verify features have been added."
182-
]
183-
},
18495
{
18596
"cell_type": "code",
18697
"execution_count": null,
@@ -192,15 +103,6 @@
192103
"map1.clear_graphics()"
193104
]
194105
},
195-
{
196-
"cell_type": "markdown",
197-
"metadata": {},
198-
"source": [
199-
"#### Use the map widget `add_layer` method to add the feature layer to the map\n",
200-
"\n",
201-
"You should see the locations you clicked in the previous steps now visualized as features in the feature layer, with symbology defined by the Create Layer tool."
202-
]
203-
},
204106
{
205107
"cell_type": "code",
206108
"execution_count": null,
@@ -216,7 +118,7 @@
216118
"metadata": {
217119
"anaconda-cloud": {},
218120
"kernelspec": {
219-
"display_name": "Python 3",
121+
"display_name": "Python [default]",
220122
"language": "python",
221123
"name": "python3"
222124
},
@@ -230,7 +132,7 @@
230132
"name": "python",
231133
"nbconvert_exporter": "python",
232134
"pygments_lexer": "ipython3",
233-
"version": "3.5.2"
135+
"version": "3.5.3"
234136
}
235137
},
236138
"nbformat": 4,

labs/import_data.ipynb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
"source": [
77
"### Important note\n",
88
"\n",
9-
"If you have not completed the [Download data lab](https://developers.arcgis.com/labs/), the code in the **The Download Data Lab** cell immediately below must be run before the **Import Data Lab** cells will run. These cells contain the code in the ArcGIS API for Python [Download data lab solution](download_data.ipynb). The LA_Hub_Datasets.zip directory from which you import data is only available in a single notebook.esri.com session."
9+
"If you have not completed the [Download data lab](https://developers.arcgis.com/labs/python/download-data), the code in the **The Download Data Lab** cell immediately below must be run before the **Import Data Lab** cells will run. These cells contain the code in the ArcGIS API for Python [Download data lab solution](download_data.ipynb). The LA_Hub_Datasets.zip directory from which you import data is only available in a single notebook.esri.com session.\n",
10+
"\n",
11+
"If you have completed the [Download data lab](https://developers.arcgis.com/labs/python/download-data) and are still in that notebooks.esri.com session, skip to [The Import Data Lab](#import_section) section of this lab."
1012
]
1113
},
1214
{
1315
"cell_type": "markdown",
1416
"metadata": {},
1517
"source": [
16-
"#### The Download Data Lab"
18+
"#### The Download Data Lab\n",
19+
"<a id='download_section'></a>"
1720
]
1821
},
1922
{
@@ -102,7 +105,8 @@
102105
"cell_type": "markdown",
103106
"metadata": {},
104107
"source": [
105-
"#### The Import Data Lab"
108+
"#### The Import Data Lab\n",
109+
"<a id='import_section'></a>"
106110
]
107111
},
108112
{

0 commit comments

Comments
 (0)