Skip to content

Commit 87e2be7

Browse files
committed
update add methods
1 parent 1ca19f3 commit 87e2be7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

samples/05_content_publishers/publishing_sd_shapefiles_and_csv.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
"root_folder = gis.content.folders.get()\n",
209209
"# Loop through each file and publish it as a service\n",
210210
"for current_sd_file in sd_file_list:\n",
211-
" item = root_folder.add({}, data_dir + current_sd_file) # .sd file is uploaded and a .sd file item is created\n",
211+
" item = root_folder.add({\"title\": \"New Layer\", \"item_type\": \"Service Definition\"}, data_dir + current_sd_file).result() # .sd file is uploaded and a .sd file item is created\n",
212212
" if \"BuildCache\" not in current_sd_file:\n",
213213
" published_item = item.publish() # .sd file item is published and a web layer item is created\n",
214214
" else:\n",
@@ -276,7 +276,7 @@
276276
],
277277
"source": [
278278
"proot_folder = p_gis.content.folders.get()\n",
279-
"uploaded_file = proot_folder.add({}, file=sd_file)\n",
279+
"uploaded_file = proot_folder.add({\"title\": \"Nursing Home Location\", \"item_type\": \"Service Definition\"}, file=sd_file).result()\n",
280280
"uploaded_file.tags"
281281
]
282282
},
@@ -387,7 +387,7 @@
387387
"outputs": [],
388388
"source": [
389389
"data = \"data/power_pedestals_2012.zip\"\n",
390-
"shpfile = root_folder.add({}, data)"
390+
"shpfile = root_folder.add({\"title\": \"power_pedestals_2012\", \"item_type\": \"Shapefile\"}, data).result()"
391391
]
392392
},
393393
{
@@ -556,7 +556,7 @@
556556
"outputs": [],
557557
"source": [
558558
"csv_file = 'data/Chennai_precipitation.csv'\n",
559-
"csv_item = root_folder.add({}, csv_file)"
559+
"csv_item = root_folder.add({\"title\": \"Chennai Precipitation\", \"item_type\": \"CSV\"}, csv_file).result()"
560560
]
561561
},
562562
{
@@ -739,7 +739,7 @@
739739
"notebookRuntimeVersion": "4.0"
740740
},
741741
"kernelspec": {
742-
"display_name": "Python 3 (ipykernel)",
742+
"display_name": "Python 3",
743743
"language": "python",
744744
"name": "python3"
745745
},
@@ -753,7 +753,7 @@
753753
"name": "python",
754754
"nbconvert_exporter": "python",
755755
"pygments_lexer": "ipython3",
756-
"version": "3.9.16"
756+
"version": "3.11.8"
757757
},
758758
"toc": {
759759
"base_numbering": 1,

0 commit comments

Comments
 (0)