import olFeature from 'ol/Feature'; import olStyleStyle from 'ol/style/Style'; import OlGeomLineString from 'ol/geom/LineString'; import { Coordinate as OlCoordinateCoordinate } from 'ol/coordinate'; import { LidarprofileConfigService as GmfLidarprofileConfigLidarprofileConfigService, LidarprofileServerConfigClassifications, LidarprofileServerConfigLevels, LidarprofileServerConfigPointAttributes, LidarprofileServerConfigPointAttribute } from 'ngeo/lidar/Config'; import { updateScaleFunction } from 'ngeo/lidar/Plot'; /** * The lidar point attribute list width default option. */ type LidarPointAttributeList = { availableOptions?: LidarprofileServerConfigPointAttributes[]; selectedOption?: LidarprofileServerConfigPointAttribute; }; /** * The object containing all points in profile. */ export type LidarprofileClientConfig = { autoWidth?: boolean; margin?: { [x: string]: number; }; pointAttributes?: LidarPointAttributeList; pointSum?: number; tolerance?: number; }; /** * The object containing all points in profile. */ export type LidarprofilePoints = { distance?: number[]; altitude?: number[]; color_packed?: number[][]; intensity?: number[]; classification?: number[]; coords?: number[][]; }; /** * Profile point after measure or after parsing of the binary array returned by Pytree. */ export type LidarPoint = { cx?: number | undefined; cy?: number | undefined; distance?: number | undefined; altitude?: number | undefined; color_packed?: number[] | undefined; coords?: number[] | undefined; intensity?: number | undefined; classification?: number | undefined; set?: boolean | undefined; }; type ClippedLine = { bufferGeom: olFeature; bufferStyle: olStyleStyle[]; clippedLine: OlCoordinateCoordinate[]; distanceOffset: number; }; type NiceLOD = { maxLOD: number; width: number; }; export default class { onload: () => void; /** * Clip a linestring with start and end measure given by D3 Chart domain. * @param config the LIDAR profile config * instance * @param map_resolution the current resolution of the map * @param linestring an OpenLayers Linestring * @param dLeft domain minimum * @param dRight domain maximum * @returns Object with clipped lined coordinates and left domain value */ clipLineByMeasure(config: GmfLidarprofileConfigLidarprofileConfigService, map_resolution: number, linestring: OlGeomLineString, dLeft: number, dRight: number): ClippedLine; /** * Get a Level Of Details and with for a given chart span * Configuration is set up in Pytree configuration. * @param span domain extent * @param max_levels levels defined * by a LIDAR server * @returns Object with optimized Level Of Details and width for this profile span */ getNiceLOD(span: number, max_levels: LidarprofileServerConfigLevels): NiceLOD; /** * Create a image file by combining SVG and canvas elements and let the user downloads it. * @param profileClientConfig The profile client configuration. */ downloadProfileAsImageFile(profileClientConfig: LidarprofileClientConfig): void; /** * Transforms a lidarprofile into multiple single points sorted by distance. * @param profilePoints in the profile * @returns An array of LIDAR Points. */ getFlatPointsByDistance(profilePoints: LidarprofilePoints): LidarPoint[]; /** * Get the data for a CSV export of the profile. * @param points A list of lidar profile point objects. * @returns Objects for a csv export (column: value). */ getCSVData(points: LidarPoint[]): { [key: string]: string | number; }[]; /** * Find the maximum value in am array of numbers. * @param array of number * @returns the maximum of input array */ arrayMax(array: number[]): number; /** * Find the minimum value in am array of numbers. * @param array of number * @returns the minimum of input array */ arrayMin(array: number[]): number; /** * Transform OpenLayers linestring into a cPotree compatible definition. * @param line the profile 2D line * @returns linestring in a cPotree/pytree compatible string definition */ getPytreeLinestring(line: OlGeomLineString): string; /** * Find the profile's closest point in profile data to the chart mouse position. * @param points Object containing points properties as arrays * @param xs mouse x coordinate on canvas element * @param ys mouse y coordinate on canvas element * @param tolerance snap sensibility * @param sx d3.scalelinear x scale * @param sy d3.scalelinear y scale * @param classification_colors * classification colors * @returns closestPoint the closest point to the clicked coordinates */ getClosestPoint(points: LidarprofilePoints, xs: number, ys: number, tolerance: number, sx: updateScaleFunction, sy: updateScaleFunction, classification_colors: LidarprofileServerConfigClassifications): undefined | LidarPoint; } export {};