This commit is contained in:
38
node_modules/geotiff/dist-module/source/basesource.js
generated
vendored
Normal file
38
node_modules/geotiff/dist-module/source/basesource.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @typedef Slice
|
||||
* @property {number} offset
|
||||
* @property {number} length
|
||||
*/
|
||||
|
||||
export class BaseSource {
|
||||
/**
|
||||
*
|
||||
* @param {Slice[]} slices
|
||||
* @returns {ArrayBuffer[]}
|
||||
*/
|
||||
async fetch(slices, signal = undefined) {
|
||||
return Promise.all(
|
||||
slices.map((slice) => this.fetchSlice(slice, signal)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Slice} slice
|
||||
* @returns {ArrayBuffer}
|
||||
*/
|
||||
async fetchSlice(slice) {
|
||||
throw new Error(`fetching of slice ${slice} not possible, not implemented`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the filesize if already determined and null otherwise
|
||||
*/
|
||||
get fileSize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
async close() {
|
||||
// no-op by default
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user