API / geotoolkit / las / LasStreamDataSection / LasStreamDataSection
las.LasStreamDataSection.LasStreamDataSection
A LAS Data Section supporting stream access.
↳
LasStreamDataSection
Constructors
• new LasStreamDataSection(section, stream, rawDataStart)
Constructor
| Name | Type | Description |
|---|---|---|
section | Options | section |
stream | LasStreamParser | The underlying LAS stream |
rawDataStart | number | The line index of the data section |
LasDataSection.constructor
Methods
▸ getAssociations(): string
Gets associations of this section
string
LasDataSection.getAssociations
▸ getData(): (string | number | string[] | number[])[]
Gets data
(string | number | string[] | number[])[]
▸ 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]| Name | Type | Description |
|---|---|---|
Optional start | number | The first depth to read (no interpolation or extrapolation) |
Optional end | number | The last depth to read (no interpolation or extrapolation) |
Optional mnemonics | string[] | The mnemonics of the curves to retain, if null, all curves will be fetched |
Optional success | Callback | A function called when the range has been read |
Optional error | Callback | A function called if the parsing fails |
Promise<number[][]>
A promise fulfilled when the range has been read
▸ 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]| Name | Type | Description |
|---|---|---|
Optional start | number | The first depth to read (no interpolation or extrapolation) |
Optional end | number | The last depth to read (no interpolation or extrapolation) |
Optional indexes | number[] | The indexes of the curves to retain, if null, all curves will be fetched |
Optional success | Callback | A function called when the range has been read |
Optional error | Callback | A function called if the parsing fails |
Promise<number[][]>
A promise fulfilled when the range has been read
▸ getName(): string
Gets name
string
▸ getNumeric(): boolean[]
Returns data from the section
boolean[]
▸ setData(data): LasStreamDataSection
Sets data
| Name | Type | Description |
|---|---|---|
data | Data | data |
▸ setName(name): LasStreamDataSection
Set section name
| Name | Type | Description |
|---|---|---|
name | string | section name |