Select to view content in your preferred language

Can't create TPK for Cache Tile Service

5428
9
11-07-2011 12:06 PM
Labels (1)
ArtUllman
Emerging Contributor
I tried to create a TPK from Desktop 10.1 with an MXD that references a 10.0 Cache Tile Service.  The analyze option tells me that this type of service (Cache Tile Service) is not supported for building a TPK.  So, how do I create a local cache of cache tiles from a Cache Tile Service for disconnected use in the Run Time?

Thanks.
0 Kudos
9 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

In Beta 1 there was no out-of-the-box way to create a Tile Package from an existing cached map service. However we hope to add an option to ArcGIS Server cached map services to allow users to request an extent to be delivered as a Tile Package (.TPK) file. I don't think that functionality will be available in beta 2 though.

In the mean time, your options are to either open the map on which your tiled map service was based and use the tile packaging functionality to create a new Tile Package. Or alternatively, if you already have a cache which you would like to use wholesale with the ArcGIS Runtime then you may be able to manually create a TPK. The Tile Package is effectively a compact cache zipped up (no additional compression) into a single file - it's designed to be as portable as possible for ease of deployment. Therefore you could try zipping up an existing compact cache folder - if you're using the 7-zip application, the archive format needs to be "zip" and compression level should be "Store" for no compression. The zip file extension should then be renamed to ".tpk". This would obviously be an unsupported workflow - but will hopefully save you some time in the interim.

Cheers

Mike
0 Kudos
ArtUllman
Emerging Contributor
Thanks.  That worked.  I created an MXD with a single vector layer for a specific county.  I created a TPK using this MXD.  I then used the Export Cache Tiles Tool to export cache tiles from my US Imagery Layer Cache Tile Service and specified the county that I wanted for the TPK.  I then renamed the TPK to ZIP, deleted the Layers folder and dropped the new Layers folder that I built using the Export Cache Tiles.  I renamed the ZIP back to TPK.  I was able to add the TPK to my map in my Run Time app.  Works great.   Looking forward to creating TPKs in ArcMap for Cache Tiles, but am very pleased with the work around for now.  I realize this is not a supported function, but it gets me by.  I am working on a proof of concept and needed imagery in an offline mode.
0 Kudos
ArtUllman
Emerging Contributor
The workaround (manually adding the cache tiles to the TPK) worked very until I went to Beta-2.  Now it is giving me the following error:

Invalid TilePackage, the tile package has compression which is not supported for direct reading.

The Tiles were created with JPEG compression.  Is there something else I need to do?  We really need background imagery for disconnected mode.  My imagery is all in Cache Tiles and Cache Tiles built from Image Services.   Neither of these formats is supported for building TPKs.  Any thoughts?

Thanks.  Product looks great.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

That error message may mean that the TPK file itself has some compression. Many changes have been made to the TPK reading since Beta 1.

However - ArcGIS 10.1 Beta 2 includes the functionality for extracting a TPK from an existing cached service. There are server admin GP tools (e.g. http://<SERVERNAME>:6080/arcgis/rest/services/System/CachingTools/GPServer/Export%20Cache) or this can be done in ArcMap/ArcCatalog - connect to an ArcGIS Server, right click on the map service and choose Manage Cache > Export Cache. But the workflow is most likely to involve using the Extract Cache tool in the Server Tools toolbox inside your own GP Model and publishing that GP Model as a service which you then consume via the API of the ArcGIS Runtime SDK for WPF.

Cheers


Mike
0 Kudos
ArtUllman
Emerging Contributor
Thanks.  I created a TPK using an existing vector layer (since this is a supported option for TPK creation), deleted the LAYERS folder in the TPK, exported the cache tiles for an AOI using the GP processing tool, then added the cache tiles to the TPK (renamed as ZIP).  I had tried this before but ran into a read file format problem.  You had already instructed me to make sure that the TPK/ZIP had no compression.  I assumed that since I used an existing file, it would not compress the tiles when adding the new files to the TPK.  It turned out this was my mistake.  When adding new files I had to make sure that the COMPRESSION=NONE option was enabled in winzip.  That did the trick.   Thanks for your help.  This was very important for the application.
0 Kudos
erdinç_kadiryildiz
Emerging Contributor
I could manage to create tpk from the catalog via ExportCache. But i cannot do it from rest api.It says that it has succeeded in 0.0 seconds. Do you have any suggestions?Or am i mistaking something while passing the parameters?
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

The capability to generate tile packages from existing cached services has been added to ArcGIS for Server 10.1 and was available in the Prerelease, but you'll need to start the caching service in the system tools folder from within the Manager application (or via an admin connection in ArcGIS for Desktop).

Cheers

Mike
0 Kudos
erdinç_kadiryildiz
Emerging Contributor
Thanks Mike for your response.My CachingTools service is already started.I can export cache via ArcCatalog ,right clicking the service ,Manage cache and Export Cache. I also tried to export cache with the geoprocessor that could be invoked from System folder in ArcCatalog.But no luck also.Exporting cache from service works fine but the geoprocessing service does not work for me.Any more suggestions perhabs?

Cheers

Erdinc
0 Kudos
erdinç_kadiryildiz
Emerging Contributor
Ah i finally found out that i was mistaken with the mapserver url.The trick was setting the url like Test/CaliforniaProjected2:MapServer.
0 Kudos