Layer Management API

Module: mls.layer. This page documents 9 public functions with exact tool IDs, complete parameters, Parameters fields, and examples.

Back to the Script Tool API Reference

Functions

  • io_add_onlinemap — Add OnlineMap
  • io_remove_onlinemap — Remove OnlineMap
  • io_remove_layer — Mapping-project only.Remove data layer from TOC/tree (supports both CObject-based data like point clouds, trajectories, and LiLayer-based data like vector layers, raster layers). DO NOT use this tool on point clouds, trajectories or image lists in Georeference (.mscan) projects - these are scan-managed and removal is ALWAYS permanently denied. The error is NOT retryable; any retry will produce the same error.If target type is scanStation, the correct tool is io_remove_scan.
  • io_remove_scan — Remove a scan station (liscan) from a Georeference (.mscan) project. Use this to delete an entire scan station from the project tree, including all its data (point clouds, trajectory, images). Does NOT affect other scans. The scan ID must be obtained from project_resolve_loaded_data where type=ScanStation.
  • set_visibility — Set visibility of one loaded data/layer by its unified id. This tool only accepts a resolved id returned by project_resolve_loaded_data or project_list_loaded_data. For user-provided names, display names, file names, path fragments, source strings, UUIDs, or natural-language references, call project_resolve_loaded_data first and then pass the resolved id here. Do not pass displayName, fileName, path, or source directly as id.
  • set_visibility_batch — Set visibility of multiple loaded data/layers by unified ids. Use this only when the user explicitly asks to show/hide multiple layers, such as all matched layers, or after the user chooses multiple candidates. Do not use this to resolve ambiguity automatically. Do not pass display names directly.
  • get_visibility — Unified layer/data id returned by project_resolve_loaded_data or project_list_loaded_data. Do not use display names, file names, paths, or source strings.
  • project_resolve_loaded_data — Resolve a user-provided data or layer reference into loaded data candidates. Use this before tools that need either a resolved id or a source path. For tools with input_paths or file_list, use the returned path/source or name according to the target schema; do not use id as a file path.
  • get_pointcloud_info — Get metadata and statistics of a point cloud layer by its resolved id from project_resolve_loaded_data. Returns point count, coordinate system, spatial extent (XYZ range and box dimensions), GPS time range, intensity range, mean/std statistics, classification statistics, and return number statistics. Only works for point cloud layers (type: pointcloud).

io_add_onlinemap

Add OnlineMap

  • Exact tool ID:io_add_OnlineMap
  • Recommended call:mls.layer.io_add_onlinemap(...)
  • Alias:io_add_OnlineMap
  • Required parameters:name

Parameters

Parameter Type Required Default Description
name string Yes — Map name
url string No — Map url

Example

from gvscript import mls

result = mls.layer.io_add_onlinemap(
    name='example_name',
    url='example',
)
print(result.ok, result.output, result.message)

io_remove_onlinemap

Remove OnlineMap

  • Exact tool ID:io_remove_OnlineMap
  • Recommended call:mls.layer.io_remove_onlinemap(...)
  • Alias:io_remove_OnlineMap
  • Required parameters:name

Parameters

Parameter Type Required Default Description
name string Yes — Map name

Example

from gvscript import mls

result = mls.layer.io_remove_onlinemap(
    name='example_name',
)
print(result.ok, result.output, result.message)

io_remove_layer

Mapping-project only.Remove data layer from TOC/tree (supports both CObject-based data like point clouds, trajectories, and LiLayer-based data like vector layers, raster layers). DO NOT use this tool on point clouds, trajectories or image lists in Georeference (.mscan) projects - these are scan-managed and removal is ALWAYS permanently denied. The error is NOT retryable; any retry will produce the same error.If target type is scanStation, the correct tool is io_remove_scan.

  • Exact tool ID:io_remove_layer
  • Recommended call:mls.layer.io_remove_layer(...)
  • Required parameters:id

Parameters

Parameter Type Required Default Description
id string Yes — Layer ID or object name/path to remove from the TOC/tree

Example

from gvscript import mls

result = mls.layer.io_remove_layer(
    id='example_id',
)
print(result.ok, result.output, result.message)

io_remove_scan

Remove a scan station (liscan) from a Georeference (.mscan) project. Use this to delete an entire scan station from the project tree, including all its data (point clouds, trajectory, images). Does NOT affect other scans. The scan ID must be obtained from project_resolve_loaded_data where type=ScanStation.

  • Exact tool ID:io_remove_scan
  • Recommended call:mls.layer.io_remove_scan(...)
  • Required parameters:id

Parameters

Parameter Type Required Default Description
id string Yes — Scan station UUID (id field of a ScanStation entry from project_resolve_loaded_data)

Example

from gvscript import mls

result = mls.layer.io_remove_scan(
    id='example_id',
)
print(result.ok, result.output, result.message)

set_visibility

Set visibility of one loaded data/layer by its unified id. This tool only accepts a resolved id returned by project_resolve_loaded_data or project_list_loaded_data. For user-provided names, display names, file names, path fragments, source strings, UUIDs, or natural-language references, call project_resolve_loaded_data first and then pass the resolved id here. Do not pass displayName, fileName, path, or source directly as id.

  • Exact tool ID:layer_set_visibility
  • Recommended call:mls.layer.set_visibility(...)
  • Required parameters:id, visible

Parameters

Parameter Type Required Default Description
id string Yes — Unified layer/data id returned by project_resolve_loaded_data or project_list_loaded_data, such as obj: for CObject data or layer: for LiLayer data. Do not use displayName or file path here.
visible boolean Yes — true to show the layer/data, false to hide it.

Example

from gvscript import mls

result = mls.layer.set_visibility(
    id='example_id',
    visible=True,
)
print(result.ok, result.output, result.message)

set_visibility_batch

Set visibility of multiple loaded data/layers by unified ids. Use this only when the user explicitly asks to show/hide multiple layers, such as all matched layers, or after the user chooses multiple candidates. Do not use this to resolve ambiguity automatically. Do not pass display names directly.

  • Exact tool ID:layer_set_visibility_batch
  • Recommended call:mls.layer.set_visibility_batch(...)
  • Required parameters:ids, visible

Parameters

Parameter Type Required Default Description
ids array Yes — Unified layer/data ids returned by project_resolve_loaded_data or project_list_loaded_data. Do not use display names, file names, paths, or source strings.
visible boolean Yes — true to show, false to hide.

Example

from gvscript import mls

result = mls.layer.set_visibility_batch(
    ids=['example_id'],
    visible=True,
)
print(result.ok, result.output, result.message)

get_visibility

Unified layer/data id returned by project_resolve_loaded_data or project_list_loaded_data. Do not use display names, file names, paths, or source strings.

  • Exact tool ID:layer_get_visibility
  • Recommended call:mls.layer.get_visibility(...)
  • Required parameters:id

Parameters

Parameter Type Required Default Description
id string Yes — Unified layer/data ids returned by project_resolve_loaded_data or project_list_loaded_data. Do not use display names, file names, paths, or source strings.

Example

from gvscript import mls

result = mls.layer.get_visibility(
    id='example_id',
)
print(result.ok, result.output, result.message)

project_resolve_loaded_data

Resolve a user-provided data or layer reference into loaded data candidates. Use this before tools that need either a resolved id or a source path. For tools with input_paths or file_list, use the returned path/source or name according to the target schema; do not use id as a file path.

  • Exact tool ID:project_resolve_loaded_data
  • Recommended call:mls.layer.project_resolve_loaded_data(...)
  • Required parameters:query

Parameters

Parameter Type Required Default Description
query string Yes — User-provided target, such as display name, file name, source path fragment, tree path, uuid, or unified id.
type_filter string No — Optional data type filter, such as pointcloud, vector, raster, trajectory, panorama, gaussian3d.
match_mode string No — Matching mode: exact, fuzzy, or all. Default is fuzzy.

Example

from gvscript import mls

result = mls.layer.project_resolve_loaded_data(
    query='example',
    type_filter='example',
    match_mode='example',
)
print(result.ok, result.output, result.message)

get_pointcloud_info

Get metadata and statistics of a point cloud layer by its resolved id from project_resolve_loaded_data. Returns point count, coordinate system, spatial extent (XYZ range and box dimensions), GPS time range, intensity range, mean/std statistics, classification statistics, and return number statistics. Only works for point cloud layers (type: pointcloud).

  • Exact tool ID:layer_get_pointcloud_info
  • Recommended call:mls.layer.get_pointcloud_info(...)
  • Required parameters:id

Parameters

Parameter Type Required Default Description
id string Yes — Unified layer/data id returned by project_resolve_loaded_data. Must be a point cloud object id. Do not use display name or file path.

Example

from gvscript import mls

result = mls.layer.get_pointcloud_info(
    id='example_id',
)
print(result.ok, result.output, result.message)

results matching ""

    No results matching ""