export type GetApiOgcCollectionsCollectionIdPositionArgs = {collectionId: string, coords?: string | undefined, z?: string | undefined, 'parameter-name'?: string | undefined, crs?: string | undefined, datetime?: string | undefined, f?: string | undefined}; export type GetApiOgcCollectionsCollectionIdPositionOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Query end point for position queries of collection {collectionId} * * GET /ogc/collections/{collectionId}/position */ export const getApiOgcCollectionsCollectionIdPosition = async (args: GetApiOgcCollectionsCollectionIdPositionArgs, options: GetApiOgcCollectionsCollectionIdPositionOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.coords != null) query.append("coords", String(args.coords)) if (args.z != null) query.append("z", String(args.z)) if (args['parameter-name'] != null) query.append("parameter-name", String(args['parameter-name'])) if (args.crs != null) query.append("crs", String(args.crs)) if (args.datetime != null) query.append("datetime", String(args.datetime)) if (args.f != null) query.append("f", String(args.f)) const url = `${baseUrl.replace(/\/+$/, '')}/ogc/collections/${encodeURIComponent(String(args.collectionId))}/position${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };