Log I/O
Loading...
Searching...
No Matches
LasFileWriter Class Referencesealed

Class for writing LAS files to disk. More...

Public Member Functions

void Append (LasFile lasFile)
 Append the curve data of the specified LAS file.
 
void Close ()
 Close the back-end stream.
 
 LasFileWriter (FileInfo file)
 Create a LAS writer for the specified file instance.
 
 LasFileWriter (Stream outputStream)
 Create a LAS file writer for the specified stream.
 
void Write (LasFile lasFile)
 Write the specified LAS file instance.
 

Static Public Member Functions

static string ToString (LasFile lasFile)
 Convenience method for returning a string representation of the specified LAS file.
 

Detailed Description

Class for writing LAS files to disk.

Typical usage:

    LasFileWriter writer = new LasFileWriter(new FileInfo("path/to/file.json"));
    writer.Write(lasFile);
    writer.Close();

If there is to much data to keep in memory, or the writing is based on a streaming source, it is possible to append chunks of data to the last LasFile instance written, like:

    LasFileWriter writer = new LasFileWriter(new FileInfo("path/to/file.json"));
    writer.Write(lasFile);
    writer.Append(lasFile);
    writer.Append(lasFile);
    :
    writer.Close();
See also
LAS 3.0 Specification
Author
Petroware AS

Constructor & Destructor Documentation

◆ LasFileWriter() [1/2]

LasFileWriter ( Stream outputStream)

Create a LAS file writer for the specified stream.

Parameters
outputStreamStream to write. Non-null.
Exceptions
ArgumentNullExceptionIf outputStream is null.

◆ LasFileWriter() [2/2]

LasFileWriter ( FileInfo file)

Create a LAS writer for the specified file instance.

Parameters
fileDisk file to write. Non-null.
Exceptions
ArgumentNullExceptionIf file is null.

Member Function Documentation

◆ Append()

void Append ( LasFile lasFile)

Append the curve data of the specified LAS file.

Parameters
lasFileLAS file of data to append to the stream. Non-null.
Exceptions
ArgumentNullExceptionIf lasFile is null.
InvalidOperationExceptionIf the writer is not open for writing.
IOExceptionIf the write operation fails for some reason.

◆ ToString()

static string ToString ( LasFile lasFile)
static

Convenience method for returning a string representation of the specified LAS file.

Parameters
lasFileLAS file to write. Non-null.
Returns
The requested string. Never null.
Exceptions
ArgumentNullExceptionIf lasFile is null.

◆ Write()

void Write ( LasFile lasFile)

Write the specified LAS file instance.

Parameters
lasFileLAS file instance to write. Non-null.
Exceptions
ArgumentNullExceptionIf lasFile is null.
IOExceptionIf the write operation fails for some reason.

The documentation for this class was generated from the following file: