Skip To Content

Manage tile package operations through the command line

The Maritime Chart Service (MCS) tile package (mcstpk.exe) supports three workflows through the command line that allow you to automate tile package processes. You can use the command line to create, update, and replace projects. Each of these workflows are described below:

  • Create a project—Create a project and initial tile package. This workflow is an alternative to using the user interface (UI) steps of creating a project and running the Create Tile Package tool.
  • Update a project—Update an existing tile package when the contents of the datasets folder change. This workflow is an alternative to using the UI to run the Update Tile Package tool.
  • Replace a project—Re-baseline an existing project by re-creating the tile package with the contents of the datasets folder. This workflow is an alternative to the UI steps of using the Save As option with running the Create Tile Package tool.

To manage a tile package project using the command line, complete the following steps:

  1. Ensure that the Maritime Chart Service tile package functionality is configured.

    Note:

    You cannot change any of the configuration settings using the command line. The command line workflow reads the settings in the controlfiles folder. If you want to change any of the default settings, you need to modify the S52DisplayProperties.xml and ServerConfiguration.xml files first.

    Learn more about modifying S-52 display properties and server configuration files.

  2. Ensure that the data you want to use is stored in the datasets directory folder.
  3. Open a command window.
  4. Copy the file path to the folder containing the mcstpk.exe tile package to the command window and press Enter to open the directory.
  5. Type mcstpk.exe followed by the operations described in the next sections to create, update, or replace an MCS tile package project.

Create a project

The create_project operation allows you to create a project file (.mcs) and baseline tile package (*_0.tpk) file. The order of parameters is not enforced.

The parameters for the create_project operation are described in the table below:

ParameterSyntaxDescription

Project file

-project_file="<string>"

Example:

-project_file="C:\project\global.mcs"

The project file that will be created. The string includes the project name and the location where the file will be stored.

Datasets directory

-datasets_dir="<string>"

Example:

-datasets_dir="C:\project\maritimechartservice\"

The location of the S-57 and S-63 datasets.

The specified folder must contain the S-57 and S-63 datasets.

Control files

-control_files_dir="<string>"

Example:

-control_files_dir="C:\project\maritimechartservice\"

The location of the controlfiles folder.

The specified location must contain the controlfiles folder with the MCS configuration files.

Working directory

-working_dir="<string>"

Example:

-working_dir="C:\project\maritimechartservice"

The location of the working directory folder.

The specified folder must contain the logs and sencs folders.

X maximum

-x_max=<decimal degrees>

Example:

-x_max=179

The maximum longitude value that will be included in the extent of the tiles. This value represents the right edge of the tiles.

X minimum

-x_min=<decimal degrees>

Example:

-x_min=-179

The minimum longitude value that will be included in the extent of the tiles. This value represents the left edge of the tiles.

Y maximum

y_max=<decimal degrees>

Example:

-y_max=85

The maximum latitude value that will be included in the extent of the tiles. This value represents the top edge of the tiles.

Y minimum

-y_min=<decimal degrees>

Example:

-y_min=-85

The minimum latitude value that will be included in the extent of the tiles. This value represents the bottom edge of the tiles.

Start level

-start_level=<value>

Example:

-start_level=1

The integer representation corresponds to the number of scales used to define a cache tiling scheme. This scale value defines the minimum level at which the cache tiles starts in the tile package.

The start level of detail must be less than the end level of detail. Larger values reflect larger scales that show more detail but require more storage space. Smaller values reflect smaller scales that show less detail and require less storage space. Possible values are from 1 to 23. The default is 1.

End level

-end_level=<value>

Example:

-end_level=23

The integer representation corresponds to the number of scales used to define a cache tiling scheme. This scale value defines the maximum level at which the cache tiles will be generated in the tile package.

The end level of detail must be greater than the start level of detail. Larger values reflect larger scales that show more detail but require more storage space. Smaller values reflect smaller scales that show less detail and require less storage space. Possible values are from1 to 23.

Note:

To view a list of these parameters from the command line, you can run the mcstpk.exe -help command.

Update a project

The update_project operation allows you to update an existing MCS tile package project (.mcs) file with new S-57 and S-63 datasets to produce a new tile package file with the bundles that have changed since the last update. If this is the first update, changes that have occurred since the original *_0.tpk file was created are detected.

The update process uses the existing configuration options and original input parameter values such as start and end levels. This ensures consistency between the initial *_0.tpk file and subsequent updates.

Learn more about updating a tile package using Maritime Chart Service

The input parameter for the update_project operation is project_file"<string>", where the string includes the name and location of the .mcs project file to be replaced.

For example: -project_file="C:\project\global.mcs"

Replace a project

The replace_project operation allows you to overwrite an existing MCS tile package project (.mcs) file and re-create the tile package file based on the contents of the datasets_dir folder. The order of parameters is not enforced.

This option is typically used to re-baseline a .tpk file after multiple updates have been generated. It can also be used to quickly change configuration settings and re-create the initial *_0.tpk file before applying additional updates.

This is equivalent to the UI workflow in which you save the tile package as a new file with a new name using the Save As option with running the Create Tile Package tool to re-create the baseline *_0.tpk file.

Once the replace_project operation is run, you can update the datasets folder with new S-57 or S-63 datasets and run the mcstpk.exe tile package with the update_project operation.

Learn more about overwriting a project

The inputs for the replace_project operation are the same as those for the create_project operation. These parameters are described in the following table:

ParameterSyntaxDescription

Project file

-project_file="<string>"

Example:

-project_file="C:\project\global.mcs"

The project file that will be created. The string includes the project name and the location where the file will be stored.

Datasets directory

-datasets_dir="<string>"

Example:

-datasets_dir="C:\project\maritimechartservice\"

The location of the S-57 and S-63 datasets.

The specified folder must contain the S-57 and S-63 datasets.

Control files

-control_files_dir="<string>"

Example:

-control_files_dir="C:\project\maritimechartservice\"

The location of the controlfiles folder.

The specified location must contain the controlfiles folder with the MCS configuration files.

Working directory

-working_dir="<string>"

Example:

-working_dir="C:\project\maritimechartservice"

The location of the working directory folder.

The specified folder must contain the logs and sencs folders.

X maximum

-x_max=<decimal degrees>

Example:

-x_max=179

The maximum longitude value that will be included in the extent of the tiles. This value represents the right edge of the tiles.

X minimum

-x_min=<decimal degrees>

Example:

-x_min=-179

The minimum longitude value that will be included in the extent of the tiles. This value represents the left edge of the tiles.

Y maximum

y_max=<decimal degrees>

Example:

-y_max=85

The maximum latitude value that will be included in the extent of the tiles. This value represents the top edge of the tiles.

Y minimum

-y_min=<decimal degrees>

Example:

-y_min=-85

The minimum latitude value that will be included in the extent of the tiles. This value represents the bottom edge of the tiles.

Start level

-start_level=<value>

Example:

-start_level=1

The integer representation corresponds to the number of scales used to define a cache tiling scheme. This scale value defines the minimum level at which the cache tiles starts in the tile package.

The start level of detail must be less than the end level of detail. Larger values reflect larger scales that show more detail but require more storage space. Smaller values reflect smaller scales that show less detail and require less storage space. Possible values are from 1 to 23. The default is 1.

End level

-end_level=<value>

Example:

-end_level=23

The integer representation corresponds to the number of scales used to define a cache tiling scheme. This scale value defines the maximum level at which the cache tiles will be generated in the tile package.

The end level of detail must be greater than the start level of detail. Larger values reflect larger scales that show more detail but require more storage space. Smaller values reflect smaller scales that show less detail and require less storage space. Possible values are from1 to 23.

Note:

To view a list of these parameters from the command line, you can run the mcstpk.exe -help command.