src.inout.writer

Classes

Writer([path])

Exceptions

WriterException([message])

exception src.inout.writer.WriterException(message='')
Author:

Alberto M. Esmoris Pena

Class for exceptions related to writing components. See VL3DException

__init__(message='')
class src.inout.writer.Writer(path=None)
Author:

Alberto M. Esmoris Pena

Class for writing tasks/operations (mostly to be used in pipelines).

Variables:

path (str) – The path to the output file for writing operations.

static extract_writer_args(spec)

Extract the arguments to initialize/instantiate a Writer from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a Writer.

__init__(path=None)

Initialize/instantiate a Writer

Parameters:

path – The path itself. It might (or NOT) need a prefix. Any path that starts with “*” in the context of a Writer will need a prefix.

write(pcloud, prefix=None, info=True)

Write the given point cloud.

Parameters:
  • pcloud (PointCloud) – The point cloud to be written.

  • prefix (str) – If None, the writing applies to path. If not None, the writing applies to prefix+path. See writer.Writer.prepare_path().

  • info (bool) – Whether to log an info message (True) or not (False).

prepare_path(prefix)

Merge the path with the prefix to obtain the actual path for the writing.

Parameters:

prefix (str or None) – When given (i.e., not None), it is expected to be a string whose last character is an asterisk *. In this casde, the path should also be a string whose first character is an asterisk *. Thus, the resulting path will be the concatenation of what comes before the asterisk of the prefix and what comes after the asterisk of the relative path (self.path).

Returns:

Prepared path.

Return type:

str

needs_prefix()

Check whether the Writer needs a prefix for write operations or not.

Returns:

True if the Writer needs a prefix, False otherwise.