import tiles operation

1701
5
12-13-2016 06:48 AM
roialgavish
New Contributor III

Hello,

I am trying to use the import tiles operation from the ArcGIS rest API, I uploaded a TPK and publish it as a tile layer in ArcGIS online. Then I uploaded the same TPK and tried to use the import tiles operation and he gave me this error:

Invalid min scale in the specified source item

Any ideas?

0 Kudos
5 Replies
CherylHagevik
Esri Contributor

Hi Roi,

It looks like there is an issue with the way that the scales are written to the mapserver.json file within the tile package that is causing this error. This issue has now been logged as [BUG-000104517 : Create Map Tile Package geoprocessing tool does not apply value for minimum and maximum scale in the mapserver.json file.]

Here are the workaround options:

Option 1: Use one of the following methods to create the tile package, where the same issue does not occur:
ArcMap > Manage Tile Cache tool > Export Tile Cache tool
Pro > Share as web layer > with options for Tiles and Cache locally

Option 2: Manually edit the mapserver.json file and then repackage the tpk. Repackage using Archive format- zip and Compression level- Store.

Feel free to let me know if you have any questions about this. Thanks! Cheryl

AndyWells
Occasional Contributor II

I'm running into this same issue, and I am trying to edit the mapserver.json file. What exactly are we supposed to edit in the mapserver.json file?

0 Kudos
CherylHagevik
Esri Contributor

The screen shot below shows the portion of the mapserver.json file to update. The minScale and maxScale should be updated to match your designated scales, for example:

"minScale": 288895.27714399999,
"maxScale": 9027.9774109999998

0 Kudos
CherylHagevik
Esri Contributor

To help clarify the workaround options for this issue:

Option 1 shows workflows that can be used to first create the tile package and service in order to avoid the issue altogether. This option is not intended to fix a tile package and service that are already showing the issue. 

For option 2, after making the edits to the mapserver.json file, a specific method should be used to repackage the tpk. Are you repackaging using Archive format- zip and Compression level- Store? If so, can you share more about the errors you are seeing?

0 Kudos
CherylHagevik
Esri Contributor

The issue described in this post should only occur when using the Create Map Tile Package geoprocessing tool. Other workflows for creating tile packages should not show the same issue. After creating a tile package and service with one of the workflows described in Option 1 and you need to update the existing service, there are a few options to consider. These are described in the following article: FAQ: Is it possible to update tiles in a Tile Service hosted in ArcGIS Online? 

It seems like Method 3 is the best option for updating tiles when publishing from Pro or ArcMap originally and avoiding spending any credits on tile generation (which it looks like you were trying when running into the Invalid scale error). For creating the tpk to use with the Import Tiles workflow while avoiding BUG-000104517, the following workflow can be used in ArcMap or Pro: Manage Tile Cache tool > Export Tile Cache tool (Use Tile Package for the Export Cache As parameter)

For the repackaging in Option 2, an Esri tool is not required for this. This type of compression can be performed through 7-Zip which is available for free download here: https://www.7-zip.org/ 

0 Kudos