Last updated

API / geotoolkit / las / LasStreamDataSection / LasStreamDataSection

Class: LasStreamDataSection

las.LasStreamDataSection.LasStreamDataSection

A LAS Data Section supporting stream access.

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new LasStreamDataSection(section, stream, rawDataStart)

new LasStreamDataSection(section, stream, rawDataStart)

Constructor

Parameters

Name Type Description
sectionOptionssection
streamLasStreamParserThe underlying LAS stream
rawDataStartnumberThe line index of the data section

Overrides

LasDataSection.constructor

Methods

getAssociations

getAssociations(): string

Gets associations of this section

Returns

string

Inherited from

LasDataSection.getAssociations


getData

getData(): (string | number | string[] | number[])[]

Gets data

Returns

(string | number | string[] | number[])[]

Inherited from

LasDataSection.getData


getDataInRange

getDataInRange(start?, end?, mnemonics?, success?, error?): Promise<number[][]>

Reads the values for the given range.
Note that the range will not be extrapolated nor the values interpolated in the case the given start/end do not exist in the file (see examples).

Also, this function will not reorder the data nor reorder the given start/end (if start > depth).
It assumes those are coherent with the LAS data order.
For example, providing start>end for a dataset that has an increasing index will not work properly.

Note that, for convenience, this function returns a Promise AND accepts callbacks (that do not contribute to the returned promise).
One is free to use either the Promise or the callback to be 'notified' when the stream is ready.

Example

// File depths: 10,20,30,40
getDataInRange(0,20); // => values returned are for depths [10, 20]
getDataInRange(30,50); // => values returned are for depths [30, 40]
getDataInRange(35,50); // => values returned are for depths [40]
getDataInRange(5,15); // => values returned are for depths [10]

Parameters

Name Type Description
Optional startnumberThe first depth to read (no interpolation or extrapolation)
Optional endnumberThe last depth to read (no interpolation or extrapolation)
Optional mnemonicsstring[]The mnemonics of the curves to retain, if null, all curves will be fetched
Optional successCallbackA function called when the range has been read
Optional errorCallbackA function called if the parsing fails

Returns

Promise<number[][]>

A promise fulfilled when the range has been read


getDataInRangeByIndex

getDataInRangeByIndex(start?, end?, indexes?, success?, error?): Promise<number[][]>

Reads the values for the given range.
Note that the range will not be extrapolated nor the values interpolated in the case the given start/end do not exist in the file (see examples).

Also, this function will not reorder the data nor reorder the given start/end (if start > depth).
It assumes those are coherent with the LAS data order.
For example, providing start>end for a dataset that has an increasing index will not work properly.

Note that, for convenience, this function returns a Promise AND accepts callbacks (that do not contribute to the returned promise).
One is free to use either the Promise or the callback to be 'notified' when the stream is ready.

Example

// File depths: 10,20,30,40
getDataInRange(0,20); // => values returned are for depths [10, 20]
getDataInRange(30,50); // => values returned are for depths [30, 40]
getDataInRange(35,50); // => values returned are for depths [40]
getDataInRange(5,15); // => values returned are for depths [10]

Parameters

Name Type Description
Optional startnumberThe first depth to read (no interpolation or extrapolation)
Optional endnumberThe last depth to read (no interpolation or extrapolation)
Optional indexesnumber[]The indexes of the curves to retain, if null, all curves will be fetched
Optional successCallbackA function called when the range has been read
Optional errorCallbackA function called if the parsing fails

Returns

Promise<number[][]>

A promise fulfilled when the range has been read


getName

getName(): string

Gets name

Returns

string

Inherited from

LasDataSection.getName


getNumeric

getNumeric(): boolean[]

Returns data from the section

Returns

boolean[]

Inherited from

LasDataSection.getNumeric


setData

setData(data): LasStreamDataSection

Sets data

Parameters

Name Type Description
dataDatadata

Returns

LasStreamDataSection

Inherited from

LasDataSection.setData


setName

setName(name): LasStreamDataSection

Set section name

Parameters

Name Type Description
namestringsection name

Returns

LasStreamDataSection

Inherited from

LasDataSection.setName