Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 11 additions & 11 deletions guide/03-the-gis/cloning-content.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -104,7 +104,7 @@
"from arcgis.gis import GIS, Item\n",
"from arcgis.env import active_gis\n",
"from arcgis.features import FeatureLayerCollection\n",
"from arcgis.mapping import WebMap"
"from arcgis.map import Map"
]
},
{
Expand Down Expand Up @@ -1167,21 +1167,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's use the WebMap object to print information about each of the layers in the Web Map. We'll look at the layer name and the url, specifically paying attention to the beginning of the path componenet of the url, which contains the organization id of the host of the layer."
"Let's use the Map object to print information about each of the layers in the Web Map. We'll look at the layer name and the url, specifically paying attention to the beginning of the path componenet of the url, which contains the organization id of the host of the layer."
]
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"wm_obj = WebMap(power_plant_wm_item)"
"wm_obj = Map(item=power_plant_wm_item)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -1197,7 +1197,7 @@
}
],
"source": [
"for wm_lyr in wm_obj.definition[\"operationalLayers\"]:\n",
"for wm_lyr in wm_obj.content.layers:\n",
" print(f\"{wm_lyr['title']}\\n{' '*2}{wm_lyr['url']}\")\n",
" print(f\"{' ' * 2}Host Organization id: {wm_lyr['url'].split('/')[3]}\")\n",
" print(\"\\n\")"
Expand Down Expand Up @@ -1277,16 +1277,16 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cloned_wm_obj = WebMap(cloned_wm[1])"
"cloned_wm_obj = Map(cloned_wm[1])"
]
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -1302,7 +1302,7 @@
}
],
"source": [
"for wm_lyr in cloned_wm_obj.definition[\"operationalLayers\"]:\n",
"for wm_lyr in cloned_wm_obj.content.layers:\n",
" print(f\"{wm_lyr['title']}\\n{' '*2}{wm_lyr['url']}\")\n",
" print(f\"{' ' * 2}Host Organization id: {wm_lyr['url'].split('/')[3]}\")\n",
" print(\"\\n\")"
Expand Down
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 `mapping` 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 @@ -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
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": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -160,12 +159,12 @@
" \"\"\"\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 = list(wm.content.layers)\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 +189,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -202,17 +201,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",
" for operationalLayer in ws.content.layers:\n",
" if 'layers' in operationalLayer:\n",
" for layer in operationalLayer['layers']:\n",
" all_layers.append(layer)\n",
" else:\n",
" all_layers.append(operationalLayer)\n",
" for bm_layer in ws.get('baseMap', {}).get('baseMapLayers', []):\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
14 changes: 8 additions & 6 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
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"from arcgis.gis import GIS\n",
"from arcgis.map import Map, Scene"
]
Expand All @@ -48,7 +47,7 @@
"metadata": {},
"source": [
"# Publish a web map\n",
"The ArcGIS API for Python extends the `WebMap` class with the capability to author new web maps and edit existing ones. You can perform basic operations such as adding, and removing layers."
"The ArcGIS API for Python extends the `Map` class with the capability to author new web maps and edit existing ones. You can perform basic operations such as adding, and removing layers."
]
},
{
Expand Down Expand Up @@ -230,7 +229,7 @@
"metadata": {},
"source": [
"### Publish the web map as an item to the portal\n",
"Now that the web map content is ready, we will use the `save()` method to save the `WebMap` object as a web map item in the GIS. As parameters to the `save()` method, you need to specify some essential properties for the new web map item."
"Now that the web map content is ready, we will use the `save()` method to save the `Map` object as a web map item in the GIS. As parameters to the `save()` method, you need to specify some essential properties for the new web map item."
]
},
{
Expand Down Expand Up @@ -499,7 +498,7 @@
"metadata": {},
"source": [
"### Display the web scene\n",
"We have successfully published a web scene with consisting of a basemap, elevation layer and desired web layer as the operational layer. We will read the published scene as a `WebScene` object and interact with it."
"We have successfully published a web scene with consisting of a basemap, elevation layer and desired web layer as the operational layer. We will read the published scene as a `Scene` object and interact with it."
]
},
{
Expand Down