A small TypeScript client for public SI2PEM data, including WFS, WMS, installations, planned measurements, and laboratory reports.
npm install si2pem-readerESM only.
import { SI2PEMClient, SI2PEM_WFS_FEATURE_TYPES, SI2PEM_WMS_LAYERS } from "si2pem-reader";
const si2pem = new SI2PEMClient();
const measurements = await si2pem.getFeatures({
typeName: SI2PEM_WFS_FEATURE_TYPES.allMeasures,
bbox: [19.8, 50.0, 20.2, 50.2],
});
const map = await si2pem.getWmsMap({
layers: SI2PEM_WMS_LAYERS.measurementResults,
bbox: [19.8, 50.0, 20.2, 50.2],
width: 1024,
height: 768,
transparent: true,
});Report discovery uses WFS GetFeature on public:measures_all. bbox is required in [west, south, east, north] order.
findLaboratoryReports() reads all matching measurement points across pages, then sorts and deduplicates reports by URL. count sets the number of measurement points requested per page (default 100); it does not limit the number of distinct reports returned. getLatestLaboratoryReport() uses a default page size of 10 and stops after the first page containing a matching report.
const report = await si2pem.getLatestLaboratoryReport({
stationIdentity: "1862",
bbox: [19.003611, 50.225, 19.043611, 50.265],
});
const antennas = await report?.readAntennas();