|
208 | 208 | "root_folder = gis.content.folders.get()\n", |
209 | 209 | "# Loop through each file and publish it as a service\n", |
210 | 210 | "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", |
212 | 212 | " if \"BuildCache\" not in current_sd_file:\n", |
213 | 213 | " published_item = item.publish() # .sd file item is published and a web layer item is created\n", |
214 | 214 | " else:\n", |
|
276 | 276 | ], |
277 | 277 | "source": [ |
278 | 278 | "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", |
280 | 280 | "uploaded_file.tags" |
281 | 281 | ] |
282 | 282 | }, |
|
387 | 387 | "outputs": [], |
388 | 388 | "source": [ |
389 | 389 | "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()" |
391 | 391 | ] |
392 | 392 | }, |
393 | 393 | { |
|
556 | 556 | "outputs": [], |
557 | 557 | "source": [ |
558 | 558 | "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()" |
560 | 560 | ] |
561 | 561 | }, |
562 | 562 | { |
|
739 | 739 | "notebookRuntimeVersion": "4.0" |
740 | 740 | }, |
741 | 741 | "kernelspec": { |
742 | | - "display_name": "Python 3 (ipykernel)", |
| 742 | + "display_name": "Python 3", |
743 | 743 | "language": "python", |
744 | 744 | "name": "python3" |
745 | 745 | }, |
|
753 | 753 | "name": "python", |
754 | 754 | "nbconvert_exporter": "python", |
755 | 755 | "pygments_lexer": "ipython3", |
756 | | - "version": "3.9.16" |
| 756 | + "version": "3.11.8" |
757 | 757 | }, |
758 | 758 | "toc": { |
759 | 759 | "base_numbering": 1, |
|
0 commit comments