Select to view content in your preferred language

Map Tile Package Publishing Fail

2687
10
08-30-2017 07:19 PM
JingjingLi
Deactivated User

Hi,

I've tried using the following script to upload a map tile package and publish it to a hosted tile layer but it failed. The map tile package was successfully uploaded and the hosted tile layer was successfully created. However, it didn't copy the min and max scale to the service so the publishing tile process was failed.

That's the script I used.

from arcgis.gis import GIS

gis = GIS("https://www.arcgis.com", "username", "password")
cm = gis.content
print(gis._con._token)
itemProperties = {}
data = r"TileMapPackage\PlanningTeamArea_agspro.tpk"
item = cm.add(itemProperties, data=data, folder="test_automation")
if item != None:
    print(item)
    tiledServiceItem = item.publish()
    if tiledServiceItem != None:
        print("published")

that's the error message I got.

Traceback (most recent call last):
  File "D:/Data/Requests/Requests 2017/26_0511_AGOL_Automation_Test/Codes/addingItems.py", line 11, in <module>
    tiledServiceItem = item.publish()
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 4299, in publish
    serviceitem_id = self._check_publish_status(ret, folder)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 4519, in _check_publish_status
    raise Exception("No job id")
Exception: No job id

Any idea?

10 Replies
RobertWeber
Regular Contributor

Jingjing Li   I am running into issues publishing a tpk item as a hosted tile layer as well.  Except I am getting an error related to LOD.  Since the tpk item does not have tiles built for all LOD's it goes as far as creating the hosted tile layer but fails to actually publish the tiles.  There must be a place to specify min and max scales in the publish() parameters?  I am using 1.6.1

0 Kudos