Publish a Maritime Chart Service tile package
You can publish a tile package (.tpk) file created using ArcGIS Maritime server’s mcstpk.exe capability to a standalone ArcGIS Server. To do so, you must create a new map service to host the contents of the .tpk file by replacing the initial map service cache with the .tpk file cache created using the mcstpk.exe.
Refer to the steps in the sections below to publish a tile package created using the mcstpk.exe.
Create a map service for the Maritime Chart Service tile package
To publish the .tpk file created by the mcstpk.exe, you must have a map service that contains the correct extent for your data. Without the correct extent, you may not be able to view your .tpk file once published. While there are various ways to achieve this, the recommended workflow is to create a service definition file in ArcGIS Pro and publish the map service using that service definition file. The steps for this method are described in the section below.
Create a service definition file in ArcGIS Pro
You can use ArcGIS Pro to save a service definition for a map service to be published to a stand-alone ArcGIS Server site at a later time.
Learn more about service definitions for a map service
To create a service definition file, complete the following steps:
Create a new project in ArcGIS Pro.
Create a polygon feature class in the geodatabase.
Create a single polygon feature that, at a minimum, covers the extent of the tile package.
Because
.tpkfiles can be viewed natively in ArcGIS Pro, it is recommended that you load the.tpkfile as a reference layer to create the right size polygon feature.Note:
You cannot change the initial and full extent of the map service once it is created.
If you plan to expand the extent of the tpk over time, create the polygon with an extent that includes future additions to the tile package. Otherwise, you will need to create a new service definition file with the expanded polygon feature and create a new map service.
On the Edit tab, in the Manage Edits group, click Save to save your edits.
Remove any basemaps from the map.
In the Contents pane, right-click the map and click Save As Offline Service Definition > Map Service on Standalone Server.
Update the information on the General tab in the Save As Offline Service Definition pane:
Provide a name for the service definition in the Name text box.
Optionally, provide a summary and tags.
Choose the appropriate ArcGIS Server version.
Under Data, choose Copy all data.
Under Location, provide a file path in the Folder text box.
Click Analyze.
Note:
You may receive the following error message:
00374: Unique numeric IDs are not assigned.
If so, right-click the error message and click Auto-Assign IDs Sequentially.
Click Save.
Browse to the location where you want to save the file and provide a name for it, then click Save.
The file is saved as an
.sdfile and can be used to publish a map service.Complete the steps to publish a map service using the
.sdfile you created.Once you have created the map service, you need to generate the initial cache in ArcGIS Server Manager.
Create the initial map service cache in ArcGIS Server Manager
The initial cache must be created in ArcGIS Server Manager. Then it can be replaced with the tile cache from the .tpk file. Complete the following steps to create the initial cache:
Click the new map service you created.
Click Caching.
For Draw this map service, choose Using tiles from a cache.
This builds a local cache. The default location is
C:\arcgisserver\directories\arcgiscache. This may differ depending on your setup.For Draw this map service, choose Using tiles from a cache.
This builds a local cache. The default location is
<ArcGIS Server installation directory>/usr/directories/arcgiscache.Under Service Settings, check the Resampling check box and update the Minimum Scale and Maximum Scale values to the scales you want the tiles to be visible at.
Note:
This controls the minimum and maximum scale at which the data is displayed, regardless of the number of scales (levels) in the tile package
For example, if you used the start level 6 and end level 17 when creating the
.tpkfile, the minimum scale could be 36978595.474472 and the maximum scale could be 4513.988705.Learn more about zoom levels and scale
No changes are required for the Cache Settings or Tiling Scheme sections.
Click Save and Restart to build the cache.
Now that the initial map service cache is created, you can replace it with the tpk cache.
Replace map service cache with tpk cache
Once there is a map service cache, it can be replaced with the tpk cache to update the map service. You must first unzip the tpk cache to use it.
Unzip the tpk cache
To replace the map service cache with the .tpk file, the .tpk file must be renamed to use the .zip file extension.
To unzip the tpk cache, complete the following steps:
Browse to the location of the
mcstpk.exeoutput.tpkfile and edit the file name to use the.zipfile extension.Unzip the file.
There are three folders in the package:
esriinfo
servicedescriptions
v101
Open the v101 folder.
The v101 folder contains the Map1 folder and a
Map1.lyrfile.Open the Map1 folder.
The Map1 folder contains the following folder and files:
_alllayers folder
conf.cdiconf.propertiesconf.xml
These files are used to update the map service cache.
Replace existing map service cache with tpk cache
To replace the existing map service cache with the tpk cache, complete the following steps:
Browse to the map service cache using File Explorer.
The default location is
C:\arcgisserver\directories\arcgiscache\<map service>\Map.Browse to the Map folder.
The default location is
<ArcGIS Server installation directory>/usr/directories/arcgiscache/<map service>/Map.Delete the following:
_alllayers
conf.cdiconf.propertiesconf.xml
Copy the contents of the Map1 folder to
C:\arcgisserver\directories\arcgiscache\<map service>\Map.The original map service cache is replaced with the tpk file cache.
Copy the contents of the Map1 folder to
<ArcGIS Server installation directory>/usr/directories/arcgiscache/<map service>/Map.The original map service cache is replaced with the tpk file cache.
In ArcGIS Server Manager, restart the map service.
Click the Caching tab. The Tiling Scheme Scales values should now match the levels in the tpk file cache.
You can now update the minimum and maximum level of detail settings using ArcGIS Server Administrator.
Update map service settings in ArcGIS Server Administrator
Now that you have updated your map service cache with the information in your tpk file cache, you must set the minimum level of detail and maximum level of detail to display the full set of scales (levels of detail) in the tpk file cache.
Log in to ArcGIS Server Administrator.
Click Service, then click the map service you want to edit.
Under Supported Operations, click edit.
In the JSON dialog box, search for
maxLODand set the value to the largest level of detail used when creating the tile package.This value should match the End scale level provided when the tile package was created.
Search for
minLODand set the value to the smallest level of detail used when creating the tpk.This value should match the Start scale value provided when the tile package was created.
Click Save Edits.
The map service is restarted and the caching properties are updated.
Open ArcGIS Server Manager and go to the Caching tab of the map service to view the updated minimum level of detail and maximum level of detail settings.
The map service cache is updated with the necessary information from the .tpk file.
You can now view the cache by choosing one of the View In options under the MapServer endpoint. For example, you might see the following: ArcGIS JavaScript, ArcGIS Online, Map Viewer, ArcGIS Earth, or ArcGIS Pro.