@fourscore/copernicus
v1.0.0
Published
## Overview
Readme
Copernicus SDK
Overview
Login
import { login } from '@fourscore/copernicus';
const username = "someusername";
const password = "somepassword";
const accessToken = await login(username, password);Process API
import { SentinelHub } from '@fourscore/copernicus';
const evalscript = `
//VERSION=3
function setup() {
return {
input: ["B02", "B03", "B04"],
output: {
bands: 3,
sampleType: "AUTO",
},
}
}
function evaluatePixel(sample) {
return [2.5 * sample.B04, 2.5 * sample.B03, 2.5 * sample.B02]
}
`;
const request: SentinelHub.ProcessRequest = {
input: {
bounds: {
properties: {
crs: "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
},
bbox: [
13.822174072265625,
45.85080395917834,
14.55963134765625,
46.29191774991382,
],
},
data: [
{
type: "sentinel-2-l2a",
dataFilter: {
timeRange: {
from: "2022-10-01T00:00:00Z",
to: "2022-10-31T00:00:00Z",
},
},
},
],
},
output: {
width: 512,
height: 512,
responses: [
{
identifier: "default",
format: {
type: "image/png",
},
},
],
},
evalscript,
};
const imgBytes: Uint8Array = await SentinelHub.process(
request,
accessToken,
);