Skip to content

Conversation

@sguimmara
Copy link
Contributor

I took over @anton-seaice's PR #342.

This PR ensures that the options object is properly passed to the underlying from* builder functions (fromUrl(), fromCustomClient(), etc).

This fixes two issues:

Copy link
Collaborator

@TheMrCam TheMrCam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want to pass options to makeRemoteSource in fromUrls, right? We're using the same options object for GeoTIFFOptions and for makeRemoteSource#options in fromUrl and fromCustomClient, so I'd assume we'd want the same in fromUrls.

*/
export async function fromUrls(mainUrl, overviewUrls = [], options = {}, signal) {
const mainFile = await GeoTIFF.fromSource(makeRemoteSource(mainUrl, options), signal);
const mainFile = await GeoTIFF.fromSource(makeRemoteSource(mainUrl), options, signal);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't makeRemoteSource still also get the options object, like above? Same for line 757

Suggested change
const mainFile = await GeoTIFF.fromSource(makeRemoteSource(mainUrl), options, signal);
const mainFile = await GeoTIFF.fromSource(makeRemoteSource(mainUrl, options), options, signal);

const mainFile = await GeoTIFF.fromSource(makeRemoteSource(mainUrl), options, signal);
const overviewFiles = await Promise.all(
overviewUrls.map((url) => GeoTIFF.fromSource(makeRemoteSource(url, options))),
overviewUrls.map((url) => GeoTIFF.fromSource(makeRemoteSource(url), options, signal)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
overviewUrls.map((url) => GeoTIFF.fromSource(makeRemoteSource(url), options, signal)),
overviewUrls.map((url) => GeoTIFF.fromSource(makeRemoteSource(url, options), options, signal)),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants