Skip to content

CLI Reference

The following reference covers all subcommands and options you can pass to the cassini program.

cassini process

Generate a map from a single LiDAR file. The process subcommand takes the path to the LiDAR file to process as an argument:

cassini process path\to\my\tile.laz

Options

--output-dir or -o

Type: string
Default: tile

The output directory for the processed LiDAR file.

--dem

Type: string

Optional path to a GeoTIFF Digital Elevation Model in Lambert-93 to use instead of computing the Digital Elevation Model from the ground points, such as an IGN MNT LiDAR HD tile (see Use IGN DEMs). It must overlap the tile, and Cassini warns if it leaves more than one of its cells’ width of the tile uncovered, or if its cells are larger than half a meter, which gives stepped contours. Its cells that intersect the tile are copied to the output directory as dem.tif, on their own grid: a larger Digital Elevation Model does not fill the buffer around the tile.

--shapefiles

Type: string

Optional path to a directory containing shapefiles to use instead of downloading from OpenStreetMap.

This subcommand also accepts the --vegetation-layers option, the common rendering options and the OCAD export options.

cassini lidar

Run only the LiDAR processing step for a single tile. The lidar subcommand takes the path to the LiDAR file to process as an argument:

cassini lidar path\to\my\tile.laz

Options

--output-dir or -o

Type: string
Default: lidar

The output directory for the processed LiDAR file.

--dem

Type: string

Optional path to a GeoTIFF Digital Elevation Model in Lambert-93 to use instead of computing the Digital Elevation Model from the ground points, such as an IGN MNT LiDAR HD tile (see Use IGN DEMs). The LiDAR file is then read for the vegetation only, and the cells of the Digital Elevation Model that intersect the tile are copied to the output directory as dem.tif, on their own grid. The render subcommand samples it, with the DEMs of the --neighbors tiles, onto its half a meter grid.

--config or -C

Type: string

The path to the configuration file to use. If omitted, Cassini uses ./config.json when it exists, or the built-in defaults otherwise.

This subcommand also accepts the --vegetation-layers option.

cassini render

Run only the map rendering step for a single tile. The render subcommand takes the path to the directory containing the output of the LiDAR processing step as an argument:

cassini render path\lidar\step\output\directory

Options

--output-dir or -o

Type: string
Default: tile

The output directory for the processed tile.

--config or -C

Type: string

The path to the configuration file to use. If omitted, Cassini uses ./config.json when it exists, or the built-in defaults otherwise.

--neighbors or -n

Type: string[]

A list of directories containing the output of the LiDAR processing step for neighboring tiles (see this post).

--shapefiles

Type: string

Optional path to a directory containing shapefiles to use instead of downloading from OpenStreetMap.

This subcommand also accepts the common rendering options and the OCAD export options.

cassini batch

Process multiple LiDAR files at once. The batch subcommand takes the path to the directory containing the LiDAR files to process as an argument. This argument is optional, its default value is in:

cassini batch

GeoTIFF DEMs in this directory, such as IGN MNT LiDAR HD tiles, are used instead of computing the Digital Elevation Model from the ground points: each one for the tile containing the centre of its extent (see Use IGN DEMs).

Options

--output-dir or -o

Type: string
Default: out

The output directory for the processed LiDAR files.

--config or -C

Type: string

The path to the configuration file to use. If omitted, Cassini uses ./config.json when it exists, or the built-in defaults otherwise.

--threads or -t

Type: number
Default: 3

In batch mode, you can specify the number of threads used by Cassini to parallelize the work: each thread processes one tile at a time. The decompression of the LiDAR files is shared between all CPU cores whatever this number, so even --threads 1 keeps every core busy during the LiDAR step. More threads mostly speed up the render step, and use more memory (about 250 MB per thread for the LiDAR step on 1 km tiles).

cassini batch --threads 6

--skip-lidar

Type: boolean

The --skip-lidar option will skip the LiDAR processing stage of the pipeline. It will only work if you already ran cassini batch once with the same input files, as it reuses the files of that run: the DEMs , the filled Digital Elevation Model of each tile and its surroundings (dem_with_buffer.tif) and the vegetation densities, with their vegetation layers (vegetation_layers.txt). Cassini stops before deleting anything if a tile has no LiDAR output of Cassini 0.19.0 or later, or no filled Digital Elevation Model of its own. --skip-lidar cannot be combined with --vegetation-layers.

The filled Digital Elevation Model of a tile is built from the DEMs of its neighbours in that run. If you add or remove tiles in the input directory, run the batch again without --skip-lidar: the tiles next to them would keep their old surroundings.

This subcommand also accepts the --vegetation-layers option, the common rendering options and the OCAD export options.

cassini config

Output a default config.json file, that you can edit to modify the map rendering parameters.

cassini config
{
"yellow_threshold": 0.5,
"green_threshold_1": 0.2,
"green_threshold_2": 1.0,
"green_threshold_3": 2.0,
"cliff_threshold_1": 45.0,
"cliff_threshold_2": 55.0,
"dpi_resolution": 600.0
}

cassini help

Print a help message:

A software that generates highly accurate topographic maps from LiDAR data. See documentation: https://cassini-map.com.
Usage: cassini [COMMAND]
Commands:
process Generate a map from a single LiDAR file
lidar Run only the LiDAR processing step for a single tile
render Run only the map generation step for a single tile
batch Process multiple LiDAR files at once
config Output a default config.json file
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help (see more with '--help')
-V, --version Print version

The help message is olso printed if cassini is called without any arguments.

--vegetation-layers

Type: height | lidar-class
Default: height

How the LiDAR points are sorted into the low, medium and high vegetation layers, whose densities give the vegetation of the map. This option is available for the process, lidar and batch subcommands, whatever the Digital Elevation Model comes from. The possible values are:

  • height: by height above the ground, the filled Digital Elevation Model of the tile and its surroundings. Only the unclassified points and the vegetation points (classes 1, 3, 4 and 5) count, never the ground, the buildings, the water or the bridges. The low vegetation is the points up to 1 m above the ground, the medium vegetation the points from 1 m to 4 m, and the high vegetation the points from 4 m to 30 m. Points on or below the ground, or more than 30 m above it, are left out. This reads the LiDAR file twice, once for the Digital Elevation Model and once for the vegetation, unless the Digital Elevation Model comes from a file (--dem, or a Digital Elevation Model in the input directory of batch).
  • lidar-class: by the low, medium and high vegetation classes of the LiDAR classification (classes 3, 4 and 5), whatever their height. This was the only mode before Cassini 0.19.0.

process and lidar process the tile alone: in height mode, the heights near its edges are taken above a Digital Elevation Model filled without the neighbouring tiles, so they can differ from a batch run. With a Digital Elevation Model computed from the ground points, this concerns the cells next to holes in the ground points near the edges; with an IGN Digital Elevation Model , only the last quarter meter of the tile on its east and south sides.

Common rendering options

The following options are available for the process, render and batch subcommands.

--skip-vector

Type: boolean

The --skip-vector option will skip the vector processing stage of the pipeline. No file will be downloaded from OpenStreetMap and no vector features will be drawn on the map (roads, lakes…).

--skip-520

Type: boolean

The --skip-520 option will prevent the vector renderer to draw the 520 area that shall not be entered symbol.

--undergrowth

Type: none | merge | 406 | 409
Default: merge

The undergrowth rendering mode. The possible values are:

OCAD export options

The following options are available for the process, render and batch subcommands.

--ocad

Type: boolean

Also export the map as an OCAD 12 file, full-map.ocd, next to full-map.png. The file contains contours (101, 102), form lines (103), vegetation areas and the vector features (roads, paths, water, buildings…) as editable objects, clipped to the tile extent and georeferenced in RGF93 / Lambert-93.

Vegetation is exported as 403 (rough open land), 406, 408 and 410 (vegetation: slow running, walk, fight) areas, plus 409 (vegetation: walk, good visibility) in the 409 undergrowth mode. The areas follow the same thresholds as the PNG rendering, and are generalised with the ISOM 2017-2 minimum areas and widths: areas, holes and parts narrower than the minimum are merged into their surroundings. The green areas and 403 do not overlap and share the same boundary. 403 and 409 are left out under the green areas, but 409 may overlap 403, as undergrowth.png covers the yellow in full-map.png. Areas crossing the tile edge are measured whole, up to 50 m beyond it, so that neighbouring tiles keep or drop them alike. When the neighbouring tile is missing, they are measured as if they continued beyond the edge. As a result, the exported map is less green than full-map.png, whose small patches are below the ISOM minimums.

Cliffs are exported from the cells steeper than cliff_threshold_1, the ones cliffs.png draws as dots: 3.5 m dots for the cells steeper than cliff_threshold_2, 2.5 m dots for the others. Both thresholds are 60 by default, so every dot is 3.5 m:

  • Touching steep cells that fit in the 205 symbol, about 9 m across, and whose top stands at least 1 m above three quarters of the ground around them, are exported as a 205 (large boulder).
  • Where the dots merge into black wider than a 202 line drawn over 3.5 m dots, about 7 m, the black is exported as a 206 (gigantic boulder or rock pillar) area, when it is larger than the 205 symbol. Its outline follows the dots, so steep hillsides and dense groups of small cliffs are exported this way too.
  • The other steep cells are exported as 202 (cliff) lines along the middle of their steep band. A cliff leaving a 206 area is a line starting at the area’s edge. A short cliff in a slope gives a short line, and a rock too large for the 205 symbol, whose flat top is not steep, gives a line closed around its top. Branches shorter than 2 m are dropped, and so are groups of touching cells whose lines are shorter than 3 m in total, or of fewer than 4 cells. A branch ends on the line it leaves.

The 202 lines have no tags, and their direction is not meaningful. The export has no 201 (impassable cliff): cliff_threshold_2 only sets the size of the dots, which the 206 areas follow. The sizes above are ISOM 2017-2 sizes on the ground, whatever the scale of the template.

Lakes are exported as a 301.001 area with 301.004 bank lines, and buildings as a 521.003 area with 521.004 outlines, so that no bank line or outline is drawn where the tile edge cuts them. Wide road tunnels are exported as 512 (bridge / tunnel), road and footpath tunnels are left out.

With batch, the whole batch is exported to a single merged-map.ocd file in the output directory, next to the merged PNG map, instead of one file per tile. Its objects are joined across the edges between tiles: a line ending on the edge between two tiles is joined to the line of the same symbol ending within 1 m of it in the neighbouring tile, and areas of the same symbol meeting along that edge are merged into one area, together with the areas of that symbol they overlap. Objects are joined only where both tiles agree. The outer edge of the batch and the edges of missing tiles still cut them, and so does a corner where tiles meet only diagonally. Form lines are culled tile by tile, so a form line may stop at an edge where the neighbouring tile left out its continuation.

The whole batch must fit in one OCAD file at the template’s scale: about 1,670 km across at 1:10 000, or 670 km at 1:4 000. A larger batch is rejected before any tile is rendered. While the batch renders, each tile directory holds an ocad-objects.bin file. It holds the objects that do not reach the tile edges, and it is removed once merged-map.ocd is written.

--ocad-template

Type: string

Optional path to an OCAD 12 file whose colors and symbols are copied into the exported file, instead of the built-in ISOM 2017-2 symbol set (1:10 000). The map scale is also taken from this file. Its objects are not copied. Cassini checks that the template defines every symbol it exports, including the cliff symbols 202, 205 and 206, as a point, line or area symbol as its objects need, and lists the missing or mistyped ones otherwise. Requires --ocad.

--ocad-simplify

Type: number
Default value: 0.5

Tolerance in meters for simplifying the boundaries of the exported vegetation areas and the 202 cliff lines (Douglas–Peucker). The 206 areas are simplified with twice this tolerance. A larger tolerance gives fewer vertices, which makes the areas easier to edit in OCAD , at the cost of fidelity. 0 keeps every traced vertex, about one per meter of boundary. Requires --ocad.

Common options

--help or -h

Same than cassini help or cassini

--version or -V

Print the cassini version

cassini 0.4.0