export type ImageType = 'png' | 'npy' | 'tif' | 'jpeg' | 'jpg' | 'jp2' | 'webp' | 'pngraw'; export type GetApiTilesCogTileMatrixSetIdWMTSCapabilitiesXmlArgs = {tileMatrixSetId: 'CDB1GlobalGrid' | 'CanadianNAD83_LCC' | 'EuropeanETRS89_LAEAQuad' | 'GNOSISGlobalGrid' | 'LINZAntarticaMapTilegrid' | 'NZTM2000Quad' | 'UPSAntarcticWGS84Quad' | 'UPSArcticWGS84Quad' | 'UTM31WGS84Quad' | 'WGS1984Quad' | 'WebMercatorQuad' | 'WorldCRS84Quad' | 'WorldMercatorWGS84Quad', tile_format?: ImageType | undefined, tile_scale?: number | undefined, minzoom?: (number | null) | undefined, maxzoom?: (number | null) | undefined, use_epsg?: boolean | undefined, url?: (string | null) | undefined, buffer?: (number | null) | undefined, padding?: (number | null) | undefined, bidx?: (Array | null) | undefined, expression?: (string | null) | undefined, nodata?: (number | number | string | null) | undefined, unscale?: (boolean | null) | undefined, resampling?: ('nearest' | 'bilinear' | 'cubic' | 'cubic_spline' | 'lanczos' | 'average' | 'mode' | 'gauss' | 'rms' | null) | undefined, reproject?: ('nearest' | 'bilinear' | 'cubic' | 'cubic_spline' | 'lanczos' | 'average' | 'mode' | 'sum' | 'rms' | null) | undefined, algorithm?: ('hillshade' | 'contours' | 'normalizedIndex' | 'terrarium' | 'terrainrgb') | undefined, algorithm_params?: (string | null) | undefined, rescale?: (Array | null) | undefined, color_formula?: (string | null) | undefined, colormap_name?: ('turbo' | 'rplumbo' | 'turbid' | 'summer_r' | 'pubu' | 'pastel2' | 'greys' | 'oxy' | 'jet_r' | 'ylgnbu_r' | 'gist_yarg_r' | 'coolwarm_r' | 'solar_r' | 'tab20c_r' | 'balance_r' | 'algae' | 'speed' | 'rdylgn' | 'gist_yarg' | 'delta_r' | 'set2' | 'gray_r' | 'spectral' | 'rainbow' | 'jet' | 'greens_r' | 'gnuplot2' | 'flag_r' | 'topo_r' | 'viridis' | 'cubehelix' | 'spring' | 'set1_r' | 'rain_r' | 'pastel2_r' | 'tab10_r' | 'gist_gray_r' | 'hot_r' | 'gist_earth' | 'nipy_spectral_r' | 'purples' | 'twilight_r' | 'amp' | 'gist_gray' | 'copper_r' | 'brbg_r' | 'rdylbu' | 'diff_r' | 'phase_r' | 'ice_r' | 'puor' | 'curl' | 'thermal' | 'inferno_r' | 'gist_stern_r' | 'deep' | 'seismic_r' | 'set2_r' | 'dense_r' | 'seismic' | 'haline' | 'diff' | 'bwr' | 'dense' | 'rdgy' | 'tarn_r' | 'prgn' | 'blues' | 'rdylbu_r' | 'rdpu_r' | 'accent' | 'oranges' | 'matter' | 'hsv' | 'orrd_r' | 'copper' | 'brg_r' | 'pubugn' | 'blues_r' | 'rain' | 'algae_r' | 'rdbu_r' | 'rainbow_r' | 'pubu_r' | 'reds_r' | 'winter' | 'puor_r' | 'spectral_r' | 'flag' | 'inferno' | 'gnbu_r' | 'wistia_r' | 'hot' | 'prism' | 'pubugn_r' | 'balance' | 'afmhot' | 'nipy_spectral' | 'brbg' | 'spring_r' | 'terrain' | 'coolwarm' | 'cividis_r' | 'ylorbr' | 'purd_r' | 'bugn_r' | 'ylgn' | 'bupu_r' | 'amp_r' | 'turbid_r' | 'oranges_r' | 'paired' | 'magma_r' | 'oxy_r' | 'set3_r' | 'purples_r' | 'rdylgn_r' | 'plasma_r' | 'curl_r' | 'ylorrd_r' | 'plasma' | 'wistia' | 'pink' | 'bone_r' | 'set3' | 'ylgnbu' | 'tempo_r' | 'brg' | 'thermal_r' | 'dark2_r' | 'gist_heat' | 'ylorbr_r' | 'twilight' | 'prgn_r' | 'twilight_shifted_r' | 'piyg' | 'gist_earth_r' | 'speed_r' | 'gist_rainbow_r' | 'gist_rainbow' | 'gist_ncar' | 'piyg_r' | 'ylgn_r' | 'set1' | 'ice' | 'cubehelix_r' | 'tab20c' | 'binary' | 'accent_r' | 'delta' | 'bone' | 'gnuplot' | 'reds' | 'tab20' | 'greys_r' | 'gist_heat_r' | 'schwarzwald' | 'rdgy_r' | 'tab10' | 'bupu' | 'cividis' | 'pink_r' | 'tarn' | 'purd' | 'tab20_r' | 'gist_ncar_r' | 'viridis_r' | 'gist_stern' | 'gray' | 'gnbu' | 'tab20b' | 'turbo_r' | 'summer' | 'pastel1_r' | 'binary_r' | 'tempo' | 'cmrmap' | 'ylorrd' | 'matter_r' | 'afmhot_r' | 'ocean' | 'tab20b_r' | 'phase' | 'pastel1' | 'prism_r' | 'haline_r' | 'magma' | 'orrd' | 'cmrmap_r' | 'cfastie' | 'winter_r' | 'hsv_r' | 'terrain_r' | 'solar' | 'gnuplot_r' | 'topo' | 'cool_r' | 'autumn_r' | 'gnuplot2_r' | 'cool' | 'twilight_shifted' | 'ocean_r' | 'rdpu' | 'autumn' | 'greens' | 'bwr_r' | 'deep_r' | 'rdbu' | 'dark2' | 'paired_r' | 'bugn' | '2024-02-23_cumulative_change_light' | '2023-07-18_forest_area_gain_light' | '2023-07-18_forest_area_loss_light' | '2023-07-18_non_forest_light' | '2023-07-18_forest_light' | '2023-07-18_forest_area_degradation_light' | '2024-04-09_stock_light_650' | '2023-06-07_stock_light_100' | '2023-06-07_stock_light_150' | '2023-06-07_stock_light_200' | '2023-06-07_stock_light_250' | '2022-11-18_change_light') | undefined, colormap?: (string | null) | undefined, return_mask?: (boolean | null) | undefined}; export type GetApiTilesCogTileMatrixSetIdWMTSCapabilitiesXmlOptions = {baseUrl: string, APIKeyQuery?: string | undefined, fetch?: typeof fetch | undefined}; /** * Wmts * * GET /tiles/cog/{tileMatrixSetId}/WMTSCapabilities.xml */ export const getApiTilesCogTileMatrixSetIdWMTSCapabilitiesXml = async (args: GetApiTilesCogTileMatrixSetIdWMTSCapabilitiesXmlArgs, options: GetApiTilesCogTileMatrixSetIdWMTSCapabilitiesXmlOptions) => { const {baseUrl, fetch: fetchFn = fetch, APIKeyQuery} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/xml") if (args.tile_format != null) query.append("tile_format", String(args.tile_format)) if (args.tile_scale != null) query.append("tile_scale", String(args.tile_scale)) if (args.minzoom != null) query.append("minzoom", String(args.minzoom)) if (args.maxzoom != null) query.append("maxzoom", String(args.maxzoom)) if (args.use_epsg != null) query.append("use_epsg", String(args.use_epsg)) if (args.url != null) query.append("url", String(args.url)) if (args.buffer != null) query.append("buffer", String(args.buffer)) if (args.padding != null) query.append("padding", String(args.padding)) for (const item of args.bidx ?? []) query.append("bidx", String(item)) if (args.expression != null) query.append("expression", String(args.expression)) if (args.nodata != null) query.append("nodata", String(args.nodata)) if (args.unscale != null) query.append("unscale", String(args.unscale)) if (args.resampling != null) query.append("resampling", String(args.resampling)) if (args.reproject != null) query.append("reproject", String(args.reproject)) if (args.algorithm != null) query.append("algorithm", String(args.algorithm)) if (args.algorithm_params != null) query.append("algorithm_params", String(args.algorithm_params)) for (const item of args.rescale ?? []) query.append("rescale", String(item)) if (args.color_formula != null) query.append("color_formula", String(args.color_formula)) if (args.colormap_name != null) query.append("colormap_name", String(args.colormap_name)) if (args.colormap != null) query.append("colormap", String(args.colormap)) if (args.return_mask != null) query.append("return_mask", String(args.return_mask)) if (APIKeyQuery !== undefined) query.set("access_token", APIKeyQuery) const url = `${baseUrl.replace(/\/+$/, '')}/tiles/cog/${encodeURIComponent(String(args.tileMatrixSetId))}/WMTSCapabilities.xml${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 res.blob() };