Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,517 changes: 1,124 additions & 393 deletions guide/03-the-gis/cloning-content.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@
"source": [
"### Geocoding coverage\n",
"\n",
"For countries covered by a geocoding service, e.g. the ArcGIS World Geocoding Service, the address coverage, the supported language, and relative geocoding quality would vary. The `Geocoding Service Coverage` WebMap object displayed below illustrates the various levels.\n",
"For countries covered by a geocoding service, e.g. the ArcGIS World Geocoding Service, the address coverage, the supported language, and relative geocoding quality would vary. The `Geocoding Service Coverage` Map object displayed below illustrates the various levels.\n",
"\n",
"The overall geocoding quality is a function of the degree of street-level address coverage in a country, knowledge of a country's address styles, and geocoding performance for addresses in that country. The quality levels are subject to change. Typically, the quality of geocoding for a given country improves over time and may be upgraded to a better level, but there may be instances where countries are downgraded to a lower level based on user feedback.\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@
"Web maps and scenes are stored as items on your portal and their content is in JavaScript Object Notation (JSON), a text format that can easily be transferred, stored, and edited. In this guide we will observe how to work maps and scenes using the `arcgis.layers` module.\n",
"\n",
"## Working with web maps\n",
"2D maps in your GIS are stored as web map items. A web map contains a JSON defining the bookmarks, layers, their symbology, order and other cartographic information. If you are interested in learning more about this specification, refer to this [documentation](/web-map-specification/). In the `mapping` module, web maps are represented using a `WebMap` class. At version 1.3 of the Python API, the `WebMap` class has been enhanced with the ability to easily add, remove layers and a few other basic operations."
"2D maps in your GIS are stored as web map items. A web map contains a JSON defining the bookmarks, layers, their symbology, order and other cartographic information. If you are interested in learning more about this specification, refer to this [documentation](/web-map-specification/). In the `map` module, web maps are represented using a `Map` class. At version 2.4 of the Python API, the `Map` class has been enhanced with the ability to easily add, remove layers and a few other basic operations."
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display\n",
"import arcgis\n",
"from arcgis.gis import GIS\n",
"\n",
"# connect to your GIS\n",
Expand Down Expand Up @@ -121,7 +119,7 @@
"metadata": {},
"source": [
"### Creating a `Map` object\n",
"You can create an empty web map with a default basemap and no operational by initializing the `Map` class with no arguments:"
"You can create an empty web map with a default basemap and no operational layers by initializing the `Map` class with no arguments:"
]
},
{
Expand Down Expand Up @@ -220,7 +218,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also create a `WebMap` object from an existing web map item by passing the web map item as the parameter to the constructor:"
"You can also create a `Map` object from an existing web map item by passing the web map item as the parameter to the constructor:"
]
},
{
Expand Down Expand Up @@ -835,7 +833,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.13.5"
},
"toc": {
"base_numbering": 1,
Expand Down
10 changes: 5 additions & 5 deletions labs/display_web_map.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## To display a web scene in your notebook, query the `WebMap` object."
"## To display a web scene in your notebook, query the `Map` object."
]
},
{
Expand All @@ -49,9 +49,9 @@
"metadata": {},
"outputs": [],
"source": [
"from arcgis.mapping import WebMap\n",
"from arcgis.map import Map\n",
"\n",
"la_parks_trails = WebMap(webmap)\n",
"la_parks_trails = Map(item=webmap)\n",
"la_parks_trails"
]
},
Expand All @@ -68,7 +68,7 @@
"metadata": {},
"outputs": [],
"source": [
"op_layers = la_parks_trails.layers\n",
"op_layers = la_parks_trails.content.layers\n",
"print(\"The webmap has {} layers.\".format(len(op_layers)))"
]
},
Expand All @@ -78,7 +78,7 @@
"metadata": {},
"outputs": [],
"source": [
"for lyr in la_parks_trails.layers:\n",
"for lyr in la_parks_trails.content.layers:\n",
" print(\"{}\\n\\t{}\".format(lyr['id'], lyr['url']))"
]
}
Expand Down
10 changes: 5 additions & 5 deletions labs/display_web_scene.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -127,8 +127,8 @@
}
],
"source": [
"from arcgis.mapping import WebScene\n",
"la_trails = WebScene(webscene_item)\n",
"from arcgis.map import Scene\n",
"la_trails = Scene(item=webscene_item)\n",
"la_trails"
]
},
Expand All @@ -141,7 +141,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"scrolled": true
},
Expand All @@ -155,7 +155,7 @@
}
],
"source": [
"op_layers = la_trails['operationalLayers']\n",
"op_layers = la_trails.content.layers\n",
"print(\"The web scene has {} layers\".format(len(op_layers)))"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -46,8 +46,7 @@
"import logging\n",
"log = logging.getLogger()\n",
"\n",
"from arcgis.mapping import WebMap\n",
"from arcgis.mapping import WebScene\n",
"from arcgis.map import Map, Scene\n",
"from arcgis.gis import GIS\n",
"\n",
"# login with your admin profile\n",
Expand Down Expand Up @@ -148,7 +147,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -160,12 +159,18 @@
" \"\"\"\n",
" https_urls = []\n",
" http_urls = []\n",
" wm = WebMap(webmap_item)\n",
" wm = Map(item=webmap_item)\n",
"\n",
" # Concatenate all operational layers and basemap layers to one list\n",
" all_layers = list(wm.layers)\n",
" if hasattr(wm.basemap, 'baseMapLayers'):\n",
" all_layers += wm.basemap.baseMapLayers\n",
" all_layers = []\n",
" for operationalLayer in wm.content.layers:\n",
" if hasattr(operationalLayer, 'layers'):\n",
" for layer in operationalLayer.layers:\n",
" all_layers.append({\"url\":layer.url})\n",
" else:\n",
" all_layers.append({\"url\":operationalLayer.url})\n",
" if hasattr(wm.basemap.basemap, 'baseMapLayers'):\n",
" all_layers += wm.basemap.basemap.baseMapLayers\n",
"\n",
" # Test all of the layers, return the results\n",
" for layer in [layer for layer in all_layers \\\n",
Expand All @@ -190,7 +195,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 43,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -202,17 +207,17 @@
" \"\"\"\n",
" https_urls = []\n",
" http_urls = []\n",
" ws = WebScene(webscene_item)\n",
" ws = Scene(item=webscene_item)\n",
"\n",
" # Concatenate all operational layers and basemap layers to one list\n",
" all_layers = []\n",
" for operationalLayer in ws.get('operationalLayers', []):\n",
" if 'layers' in operationalLayer:\n",
" for layer in operationalLayer['layers']:\n",
" all_layers.append(layer)\n",
" for operationalLayer in ws.content.layers:\n",
" if hasattr(operationalLayer, 'layers'):\n",
" for layer in operationalLayer.layers:\n",
" all_layers.append({\"url\":layer.url})\n",
" else:\n",
" all_layers.append(operationalLayer)\n",
" for bm_layer in ws.get('baseMap', {}).get('baseMapLayers', []):\n",
" all_layers.append({\"url\":operationalLayer.url})\n",
" for bm_layer in ws.basemap.basemap.get('baseMapLayers', []):\n",
" all_layers.append(bm_layer)\n",
"\n",
" # Test all of the layers, return the results\n",
Expand Down Expand Up @@ -240,7 +245,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -285,7 +290,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -574,9 +579,7 @@
{
"cell_type": "code",
"execution_count": 58,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -1026,7 +1029,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.13.5"
},
"toc": {
"base_numbering": 1,
Expand All @@ -1043,5 +1046,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
16 changes: 9 additions & 7 deletions samples/05_content_publishers/publish_ogc_services.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from arcgis.gis import GIS\n",
"from arcgis.mapping.layers import WMTSLayer, WMSLayer\n",
"from arcgis.layers import WMTSLayer, WMSLayer\n",
"from arcgis.map import Map\n",
"\n",
"gis = GIS(\"home\")"
Expand Down Expand Up @@ -451,7 +451,7 @@
"execution_count": null,
"metadata": {},
"outputs": [
{
{
"data": {
"text/plain": [
"True"
Expand Down Expand Up @@ -665,7 +665,8 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [{
"outputs": [
{
"data": {
"text/plain": [
"True"
Expand All @@ -674,7 +675,8 @@
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}],
}
],
"source": [
"item.delete(permanent=True)"
]
Expand Down Expand Up @@ -1220,7 +1222,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, let's print the WebMap object containing the WFS service as below. Once the print job is triggered, user will be directed to `printed_file_url` (e.g. `https://<your org>.arcgis.com/home/webmap/print.html`) to download the file. Note that, for OGC WFS layers, the coordinate system of the basemap must be supported by the WFS service or the layer may not be drawn successfully. Map Viewer or Map Viewer Classic will not switch to use a compatible basemap. If the basemap is not compatible with the WFS layer, Map Viewer or Map Viewer Classic will display a message to that effect. In this case, we have used a WFS that supports `EPSG:3857`."
"Now, let's print the `Map` object containing the WFS service as below. Once the print job is triggered, user will be directed to `printed_file_url` (e.g. `https://<your org>.arcgis.com/home/webmap/print.html`) to download the file. Note that, for OGC WFS layers, the coordinate system of the basemap must be supported by the WFS service or the layer may not be drawn successfully. Map Viewer or Map Viewer Classic will not switch to use a compatible basemap. If the basemap is not compatible with the WFS layer, Map Viewer or Map Viewer Classic will display a message to that effect. In this case, we have used a WFS that supports `EPSG:3857`."
]
},
{
Expand Down Expand Up @@ -1286,7 +1288,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.10"
"version": "3.13.5"
}
},
"nbformat": 4,
Expand Down
Loading