@@ -4,10 +4,11 @@ import DataView64 from './dataview64.js';
4
4
import DataSlice from './dataslice.js' ;
5
5
import Pool from './pool.js' ;
6
6
7
- import { makeRemoteSource } from './source/remote.js' ;
7
+ import { makeRemoteSource , makeCustomSource } from './source/remote.js' ;
8
8
import { makeBufferSource } from './source/arraybuffer.js' ;
9
9
import { makeFileReaderSource } from './source/filereader.js' ;
10
10
import { makeFileSource } from './source/file.js' ;
11
+ import { BaseClient , BaseResponse } from './source/client/base.js' ;
11
12
12
13
import { fieldTypes , fieldTagNames , arrayFields , geoKeyNames } from './globals.js' ;
13
14
import { writeGeotiff } from './geotiffwriter.js' ;
@@ -684,6 +685,19 @@ export async function fromUrl(url, options = {}, signal) {
684
685
return GeoTIFF . fromSource ( makeRemoteSource ( url , options ) , signal ) ;
685
686
}
686
687
688
+ /**
689
+ * Creates a new GeoTIFF from a custom {@link BaseClient}.
690
+ * @param {BaseClient } client The client.
691
+ * @param {object } [options] Additional options to pass to the source.
692
+ * See {@link makeRemoteSource} for details.
693
+ * @param {AbortSignal } [signal] An AbortSignal that may be signalled if the request is
694
+ * to be aborted
695
+ * @returns {Promise<GeoTIFF> } The resulting GeoTIFF file.
696
+ */
697
+ export async function fromCustomClient ( client , options = { } , signal ) {
698
+ return GeoTIFF . fromSource ( makeCustomSource ( client , options ) , signal ) ;
699
+ }
700
+
687
701
/**
688
702
* Construct a new GeoTIFF from an
689
703
* [ArrayBuffer]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer}.
@@ -757,3 +771,4 @@ export function writeArrayBuffer(values, metadata) {
757
771
758
772
export { Pool } ;
759
773
export { GeoTIFFImage } ;
774
+ export { BaseClient , BaseResponse } ;
0 commit comments