Multipatch from gdb publish to ArcGIS Online

855
2
03-09-2022 03:12 AM
pavelz
by
New Contributor

Hi

First of all I would like to notify that I'm quite new to GIS and ArcGIS products therefore my question could have been asked maybe before.

My goal  : Automate publish function from ArcGIS Pro using Python script. 

I have a *.gdb (multipatch) file which contains 1 layer (File geodatabase feature classes) which I would like to publish to ArcGIS Online - (refer to "content of hdb file.png").

My current process is that I need to open ArcGIS Pro, load data - RoomGeometry (feature class)  from .gdb file and than right click on it and Share/Publish to my folder as a "Web Layer". Result is visible in "layers published on web.PNG".

I have currently used 1 day and have tried to import zipped .gdb file with following commands:

#gdbFile = gis.content.add(item_properties=serviceProp, data=gdbfilezipped, folder=folder["title"] )

#gdbFilePublished = gdbFile.publish(publish_parameters = pubProps, file_type = 'fileGeodatabase', overwrite=False)

Result of course was not the same as I expected (based on ArcGIS Pro Publish function and "layers published on web.PNG")

Than I have tried to extract from .gdb file, multipatch feature classes based on this tutorial - "Automate Scene Layer Package (SPK) creation with A... - Esri Community". Using this process I have received error on arcpy.CreateSceneLayerPackage_management("**.lyrx", "****.slp")

 

Now i'm kind of stuck and hoping that you can point me to the right direction on which api call/medhodes I need to use towads .gdb file and ArcGIS Online 🙂

0 Kudos
2 Replies
pavelz
by
New Contributor

Was able to do it. I used a combination of ArcGIS Python API and REST API (here are main functions which were used):

StageService_server
UploadServiceDefinition_server
 "/sharing/rest/content/users/" + username + "/publish"
"/arcgis/rest/admin/services/" + serviceName + "/SceneServer/rebuildCache"
0 Kudos
ErshadAhmadRafi
New Contributor

Hi, can you please share with me your experience and workflow of how were you able to share your multipatch feature class from file geodatabase to the web using ArcGIS python API and REST API?

0 Kudos