Maria Map Maker CLI: Difference between revisions
(→) |
(→) |
||
Line 11: | Line 11: | ||
Create a new product. This command should write the full path to the new product, as well as its product ID, to StdOut, so it can be piped to a subsequent command. | Create a new product. This command should write the full path to the new product, as well as its product ID, to StdOut, so it can be piped to a subsequent command. | ||
<code>-n</code>, <code>--name</code> | ==== <code>-n</code>, <code>--name</code> ==== | ||
The name of the new product. | The name of the new product. | ||
<code>-p</code>, <code>--path</code> | ==== <code>-p</code>, <code>--path</code> ==== | ||
Path where the new product will be created. | Path where the new product will be created. | ||
<code>-pmd</code>, <code>--productmetadata</code> | ==== <code>-pmd</code>, <code>--productmetadata</code> ==== | ||
Product metadata. Enter a valid product metadata key and value on the form <code>-pmd "key=value"</code>. Valid keys are: | Product metadata. Enter a valid product metadata key and value on the form <code>-pmd "key=value"</code>. Valid keys are: | ||
Line 32: | Line 29: | ||
Update the metadata of a product, or change its status. The command should write the full path to the updated product, as well as its product ID, to StdOut, so it can be piped to a subsequent command. | Update the metadata of a product, or change its status. The command should write the full path to the updated product, as well as its product ID, to StdOut, so it can be piped to a subsequent command. | ||
<code>-p</code>, <code>--path</code> | ==== <code>-p</code>, <code>--path</code> ==== | ||
Path to a valid product to update, or the path to a workspace containing products. If the path is a workspace, then option <code>--productid</code> must also be specified. | Path to a valid product to update, or the path to a workspace containing products. If the path is a workspace, then option <code>--productid</code> must also be specified. | ||
<code>-id</code>, <code>--productid</code> | ==== <code>-id</code>, <code>--productid</code> ==== | ||
The product ID to update. Requires that <code>--path</code> is specified to a workspace containing the specified product ID. | The product ID to update. Requires that <code>--path</code> is specified to a workspace containing the specified product ID. | ||
<code>-pmd</code>, <code>--productmetadata</code> | ==== <code>-pmd</code>, <code>--productmetadata</code> ==== | ||
Product metadata. Enter a valid product metadata key and value on the form <code>-pmd "key=value"</code>. Valid keys are: | Product metadata. Enter a valid product metadata key and value on the form <code>-pmd "key=value"</code>. Valid keys are: | ||
Line 51: | Line 45: | ||
* <code>virtualpath</code> | * <code>virtualpath</code> | ||
<code>-s</code>, <code>--setstatus</code> | ==== <code>-s</code>, <code>--setstatus</code> ==== | ||
Set the status of the product to <code>draft</code> or <code>released</code>. | Set the status of the product to <code>draft</code> or <code>released</code>. | ||
<code>-m</code>, <code>--generatemanifest</code> | ==== <code>-m</code>, <code>--generatemanifest</code> ==== | ||
Generate a new manifest in the product. This can be done on a released product without changing its status. Valid values are <code>true</code> or <code>false</code>. Default <code>true</code>. | Generate a new manifest in the product. This can be done on a released product without changing its status. Valid values are <code>true</code> or <code>false</code>. Default <code>true</code>. | ||
<code>-acl</code>, <code>--generateacl</code> | ==== <code>-acl</code>, <code>--generateacl</code> ==== | ||
Generate a new accompanying letter with a summary of the product content. This can be done on a released product without changing its status. Valid values are <code>true</code> or <code>false</code>. Default <code>true</code>. | Generate a new accompanying letter with a summary of the product content. This can be done on a released product without changing its status. Valid values are <code>true</code> or <code>false</code>. Default <code>true</code>. | ||
Line 66: | Line 57: | ||
Create a new dataset by importing a georeferenced dataset. The MapPreparation add-in will be used to convert the source data to the selected output format. An overlay referencing the dataset will also be created. | Create a new dataset by importing a georeferenced dataset. The MapPreparation add-in will be used to convert the source data to the selected output format. An overlay referencing the dataset will also be created. | ||
<code>-n</code>, <code>--name</code> | ==== <code>-n</code>, <code>--name</code> ==== | ||
The name of the new dataset. | The name of the new dataset. | ||
<code>-p</code>, <code>--path</code> | ==== <code>-p</code>, <code>--path</code> ==== | ||
Path to a valid product to create the dataset in, or the path to a workspace containing products. If the path is a workspace, then option <code>--productid</code> must also be specified. | Path to a valid product to create the dataset in, or the path to a workspace containing products. If the path is a workspace, then option <code>--productid</code> must also be specified. | ||
<code>-id</code>, <code>--productid</code> | ==== <code>-id</code>, <code>--productid</code> ==== | ||
The product ID to create a new dataset in. Requires that <code>--path</code> is specified to a workspace containing the specified product ID. | The product ID to create a new dataset in. Requires that <code>--path</code> is specified to a workspace containing the specified product ID. | ||
<code>-s</code>, <code>--sourcedata</code> | ==== <code>-s</code>, <code>--sourcedata</code> ==== | ||
File or directory containing supported georeferenced data to import. | File or directory containing supported georeferenced data to import. | ||
<code>-dmd</code>, <code>--datasetmetadata</code> | ==== <code>-dmd</code>, <code>--datasetmetadata</code> ==== | ||
Dataset metadata. Enter a metadata key and value on the form <code>-dmd "key=value"</code>. | Dataset metadata. Enter a metadata key and value on the form <code>-dmd "key=value"</code>. | ||
<code>-ps, --prepscript</code> | ==== <code>-ps, --prepscript</code> ==== | ||
The MapPreparation script to use when importing the data. The names are found in the displayname attribute in the MapPreparation script XML's. Default behaviour is to use the first valid script for the chosen source data. | The MapPreparation script to use when importing the data. The names are found in the displayname attribute in the MapPreparation script XML's. Default behaviour is to use the first valid script for the chosen source data. | ||
<code>-pp, --prepparam</code> | ==== <code>-pp, --prepparam</code> ==== | ||
The value of a parameter for the chosen <code>--prepscript</code>. Should be on the form <code>--prepparam "key=value"</code>. | The value of a parameter for the chosen <code>--prepscript</code>. Should be on the form <code>--prepparam "key=value"</code>. | ||
<code>-i, --includesourcedata</code> | ==== <code>-i, --includesourcedata</code> ==== | ||
Include the source data in a sub-folder "sourcedata" in the dataset folder. This folder will always be cleaned out before updating a dataset. Valid values are <code>true</code> or <code>false</code>. Default is <code>false</code>. | Include the source data in a sub-folder "sourcedata" in the dataset folder. This folder will always be cleaned out before updating a dataset. Valid values are <code>true</code> or <code>false</code>. Default is <code>false</code>. | ||
<code>--addto</code> | ==== <code>--addto</code> ==== | ||
The type of template to create for the dataset. An overlay referencing the dataset will also be created. Valid values are 'overlay', 'basemap' and 'none'. Default is 'overlay'. | The type of template to create for the dataset. An overlay referencing the dataset will also be created. Valid values are 'overlay', 'basemap' and 'none'. Default is 'overlay'. | ||
<code>--elevationdatatype</code> | ==== <code>--elevationdatatype</code> ==== | ||
The elevation data type. Valid values are <code>undefined</code>, <code>terrainmodel</code>, <code>surfacemodel</code> and <code>bathymetry</code>. Default is <code>terrainmodel</code>. | The elevation data type. Valid values are <code>undefined</code>, <code>terrainmodel</code>, <code>surfacemodel</code> and <code>bathymetry</code>. Default is <code>terrainmodel</code>. | ||
<code>--tags</code> | ==== <code>--tags</code> ==== | ||
Comma separated list of text tags applicable to elevation data only. | Comma separated list of text tags applicable to elevation data only. | ||
<code>--epsg</code> | ==== <code>--epsg</code> ==== | ||
EPSG code of the source dataset if this information is not embedded. | EPSG code of the source dataset if this information is not embedded. | ||
Line 117: | Line 96: | ||
Import source data, overwriting the data file in an existing dataset. This command shares many of the options of the <code>New-Dataset</code> command. | Import source data, overwriting the data file in an existing dataset. This command shares many of the options of the <code>New-Dataset</code> command. | ||
<code>--signature</code> | ==== <code>--signature</code> ==== | ||
The unique map signature of the dataset to update. | The unique map signature of the dataset to update. | ||
<code>-p</code>, <code>--path</code> | ==== <code>-p</code>, <code>--path</code> ==== | ||
Path to a valid product where the specified dataset can be found. If the path is a workspace, then option <code>--productid</code> must also be specified. | Path to a valid product where the specified dataset can be found. If the path is a workspace, then option <code>--productid</code> must also be specified. | ||
<code>-id</code>, <code>--productid</code> | ==== <code>-id</code>, <code>--productid</code> ==== | ||
The product ID where the specified dataset can be found. Requires that <code>--path</code> is specified to a workspace containing the specified product ID. | The product ID where the specified dataset can be found. Requires that <code>--path</code> is specified to a workspace containing the specified product ID. | ||
<code>-s</code>, <code>--sourcedata</code> | ==== <code>-s</code>, <code>--sourcedata</code> ==== | ||
File or directory containing supported georeferenced data to import. | File or directory containing supported georeferenced data to import. | ||
<code>-dmd</code>, <code>--datasetmetadata</code> | ==== <code>-dmd</code>, <code>--datasetmetadata</code> ==== | ||
Dataset metadata. Enter a metadata key and value on the form <code>-dmd key=value</code>. | Dataset metadata. Enter a metadata key and value on the form <code>-dmd key=value</code>. | ||
<code>--prepscript</code> | ==== <code>--prepscript</code> ==== | ||
The MapPreparation script to use when importing the data. The names are found in the displayname attribute in the MapPreparation script XML's. Default behaviour is to use the first valid script for the chosen source data. | The MapPreparation script to use when importing the data. The names are found in the displayname attribute in the MapPreparation script XML's. Default behaviour is to use the first valid script for the chosen source data. | ||
<code>--prepparam</code> | ==== <code>--prepparam</code> ==== | ||
The value of a parameter for the chosen <code>--prepscript</code>. Should be on the form <code>--prepparam "key=value"</code>. | The value of a parameter for the chosen <code>--prepscript</code>. Should be on the form <code>--prepparam "key=value"</code>. | ||
<code>--includesourcedata</code> | ==== <code>--includesourcedata</code> ==== | ||
Include the source data in a sub-folder "sourcedata" in the dataset folder. This folder will always be cleaned out before updating a dataset. Valid values are <code>true</code> or <code>false</code>. Default is <code>false</code>. | Include the source data in a sub-folder "sourcedata" in the dataset folder. This folder will always be cleaned out before updating a dataset. Valid values are <code>true</code> or <code>false</code>. Default is <code>false</code>. | ||
<code>--elevationdatatype</code> | ==== <code>--elevationdatatype</code> ==== | ||
The elevation data type. Valid values are <code>undefined</code>, <code>terrainmodel</code>, <code>surfacemodel</code> and <code>bathymetry</code>. Default is <code>terrainmodel</code>. | The elevation data type. Valid values are <code>undefined</code>, <code>terrainmodel</code>, <code>surfacemodel</code> and <code>bathymetry</code>. Default is <code>terrainmodel</code>. | ||
<code>--tags</code> | ==== <code>--tags</code> ==== | ||
Comma separated list of text tags applicable to elevation data only. | Comma separated list of text tags applicable to elevation data only. | ||
<code>--epsg</code> | ==== <code>--epsg</code> ==== | ||
EPSG code of the source dataset if this information is not embedded. | EPSG code of the source dataset if this information is not embedded. | ||
Revision as of 15:27, 28 June 2024
From version 4.4
MariaMapMakerCLI (command line interface) is a tool to create and update products and datasets. It offers a subset of the functionality of Maria Map Maker. It can be used in scripts to automate the process of frequently updating datasets. It can also be integrated into other systems to produce Maria GDK compatible products and datasets.
The tool is distributed with the main Maria Map Maker application.
Commands
The tool divides functionality into 4 main commands. Each of these have a set of options, listed below. All commands and options are case insensitive. To see an overview of all commands, run MariaMapMakerCLI.exe without any arguments.
New-Product
Create a new product. This command should write the full path to the new product, as well as its product ID, to StdOut, so it can be piped to a subsequent command.
-n
, --name
The name of the new product.
-p
, --path
Path where the new product will be created.
-pmd
, --productmetadata
Product metadata. Enter a valid product metadata key and value on the form -pmd "key=value"
. Valid keys are:
displayname
displayversion
previewimage
description
virtualpath
Update-Product
Update the metadata of a product, or change its status. The command should write the full path to the updated product, as well as its product ID, to StdOut, so it can be piped to a subsequent command.
-p
, --path
Path to a valid product to update, or the path to a workspace containing products. If the path is a workspace, then option --productid
must also be specified.
-id
, --productid
The product ID to update. Requires that --path
is specified to a workspace containing the specified product ID.
-pmd
, --productmetadata
Product metadata. Enter a valid product metadata key and value on the form -pmd "key=value"
. Valid keys are:
displayname
displayversion
source
previewimage
description
virtualpath
-s
, --setstatus
Set the status of the product to draft
or released
.
-m
, --generatemanifest
Generate a new manifest in the product. This can be done on a released product without changing its status. Valid values are true
or false
. Default true
.
-acl
, --generateacl
Generate a new accompanying letter with a summary of the product content. This can be done on a released product without changing its status. Valid values are true
or false
. Default true
.
New-Dataset
Create a new dataset by importing a georeferenced dataset. The MapPreparation add-in will be used to convert the source data to the selected output format. An overlay referencing the dataset will also be created.
-n
, --name
The name of the new dataset.
-p
, --path
Path to a valid product to create the dataset in, or the path to a workspace containing products. If the path is a workspace, then option --productid
must also be specified.
-id
, --productid
The product ID to create a new dataset in. Requires that --path
is specified to a workspace containing the specified product ID.
-s
, --sourcedata
File or directory containing supported georeferenced data to import.
-dmd
, --datasetmetadata
Dataset metadata. Enter a metadata key and value on the form -dmd "key=value"
.
-ps, --prepscript
The MapPreparation script to use when importing the data. The names are found in the displayname attribute in the MapPreparation script XML's. Default behaviour is to use the first valid script for the chosen source data.
-pp, --prepparam
The value of a parameter for the chosen --prepscript
. Should be on the form --prepparam "key=value"
.
-i, --includesourcedata
Include the source data in a sub-folder "sourcedata" in the dataset folder. This folder will always be cleaned out before updating a dataset. Valid values are true
or false
. Default is false
.
--addto
The type of template to create for the dataset. An overlay referencing the dataset will also be created. Valid values are 'overlay', 'basemap' and 'none'. Default is 'overlay'.
--elevationdatatype
The elevation data type. Valid values are undefined
, terrainmodel
, surfacemodel
and bathymetry
. Default is terrainmodel
.
--tags
Comma separated list of text tags applicable to elevation data only.
--epsg
EPSG code of the source dataset if this information is not embedded.
Update-Dataset
Import source data, overwriting the data file in an existing dataset. This command shares many of the options of the New-Dataset
command.
--signature
The unique map signature of the dataset to update.
-p
, --path
Path to a valid product where the specified dataset can be found. If the path is a workspace, then option --productid
must also be specified.
-id
, --productid
The product ID where the specified dataset can be found. Requires that --path
is specified to a workspace containing the specified product ID.
-s
, --sourcedata
File or directory containing supported georeferenced data to import.
-dmd
, --datasetmetadata
Dataset metadata. Enter a metadata key and value on the form -dmd key=value
.
--prepscript
The MapPreparation script to use when importing the data. The names are found in the displayname attribute in the MapPreparation script XML's. Default behaviour is to use the first valid script for the chosen source data.
--prepparam
The value of a parameter for the chosen --prepscript
. Should be on the form --prepparam "key=value"
.
--includesourcedata
Include the source data in a sub-folder "sourcedata" in the dataset folder. This folder will always be cleaned out before updating a dataset. Valid values are true
or false
. Default is false
.
--elevationdatatype
The elevation data type. Valid values are undefined
, terrainmodel
, surfacemodel
and bathymetry
. Default is terrainmodel
.
--tags
Comma separated list of text tags applicable to elevation data only.
--epsg
EPSG code of the source dataset if this information is not embedded.
Exit codes
Exit codes are output from MariaMapMakerCLI to indicate the result of the command.
Code | Description |
---|---|
0 | OK |
1 | Command options error |
2 | Unknown product |
3 | Service error |
4 | Service settings error |
5 | Illegal operation on released product |
6 | Unknown error |
Examples
Create a new product and then import a dataset into it:
MariaMapMakerCLI.exe New-Product --name "AIRAC export" -pmd "displayversion=2023-04" -pmd "virtualpath=Norway\Aeronautical" -pmd "previewimage=c:\work\airac_preview.png" --path "c:\myproduct\"
MariaMapMakerCLI.exe New-Dataset --path "c:\myproduct\AIRAC_export_v1_asf45345" --sourcedata "c:\srcfiles\airac\airac.tif" -dmd "datadate=2023-04-15" -dmd "description=Aearonautical charts covering Norway"
Set a released product to "Draft", update a dataset, and set to "Released":
MariaMapMakerCLI.exe Update-Product --path "c:\products\" --productid "9075c2fb-ef9f-4300-9008-83f4ecef0ec5" --setstatus "draft"
MariaMapMakerCLI.exe Update-Dataset --path "c:\products\" --productid "9075c2fb-ef9f-4300-9008-83f4ecef0ec5" --signature "IskantSat_456afe46346" --sourcedata "c:\iskant-2023-05-20.tif" -dmd "datadate=2023-05-20" --prepscript "Geopackage (Scale to 8bit)" --prepparam "nodata=255 255 252" --includesourcedata "true"
MariaMapMakerCLI.exe Update-Product --path "c:\products\" --productid "9075c2fb-ef9f-4300-9008-83f4ecef0ec5" --setstatus "released" -pmd "displayversion=2023-05"
The following example is a Powershell script which sets a specified product to "Draft", updates each dataset with new data, updates metadata, and finally sets the product to "Released".
$m3cli = "MariaMapMakerCLI.exe"
$productpath = "F:\workspace\NorwayTopo-update-test\NorwayTopoRaster_v32_859f2d06"
# Hashtable of map signatures in the product and corresponding source data folder
$updates = @{ N5000 = "F:\Geotiff_hovedkartserien\N5000 Raster TIFF-format";
N2000 = "F:\Geotiff_hovedkartserien\N2000 Raster TIFF-format";
N1000 = "F:\Geotiff_hovedkartserien\N1000 Raster TIFF-format";
N500 = "F:\Geotiff_hovedkartserien\N500 Raster TIFF-format";
N250 = "F:\Geotiff_hovedkartserien\N250 Raster TIFF-format";}
# Set product to draft. This command returns two values:
# the new product path [0] and the product ID [1].
[array]$product = . $m3cli Update-Product --setstatus "draft"
# Update each dataset in turn
foreach($signature in $updates.Keys)
{
Write-host "Updating $signature with data from $($updates[$signature])"
. $m3cli Update-Dataset `
--path $product[0] `
--sourcedata $($updates[$signature]) `
--prepparam "nodata=255 255 252" `
--prepparam "tile_format=PNG8" `
--datasetmetadata "datadate=2023-11-01" `
--datasetmetadata "metadatadate=2023-11-15"
}
# Update product metadata and release
. $m3cli Update-Product --path $product[0] --productmetadata "displayversion=2023-11"
. $m3cli Update-Product --path $product[0] --setstatus "released"