AnsweredAssumed Answered

Can I publish a scene layer package using this API?

Question asked by mkmoeyesrimalaysia-com-my-esridist Employee on Mar 10, 2017
Latest reply on Mar 15, 2017 by mkmoeyesrimalaysia-com-my-esridist


I've been trying to programmatically upload a scene layer package and eventually publish it as a scene layer. The idea is that my web scene will get updated layers frequently, so I need to automate uploading, publishing, and reediting the web scene.


My issue is that while trying this on the ArcGIS Pro Python console:


from arcgis.gis import GIS
gis = GIS("", "xxxx", "xxxxx")
slpk_path = r"D:\Documents\ArcGIS\Projects\MMD\Rainfall_pointsample_few.slpk"
slpk_properties={'title':'rainfall_test', 'description':'rainfall test', 'tags':'test', 'type':'Scene Package'}
rainfall_item = gis.content.add(item_properties=slpk_properties, data=slpk_path)


At the publish statement, I got the following error:

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\", line 2818, in publish elif fileType == 'CSV':

UnboundLocalError: local variable 'fileType' referenced before assignment


What's the best way to tackle this issue?



Ken Moey