0.1.0 • Published 3 years ago

wcontour v0.1.0

Weekly downloads
-
License
LGPL-3.0
Repository
github
Last release
3 years ago

wcontour-js

A JavaScript Library of wContour.

import { Contour, uti } from 'wcontour';

const contour = new Contour(data, x, y, undef);
const anlValues = [-10, 0, 10, 20, 30, 40];
const contours = contour.tracingContourLines(anlValues);
uti.smoothLines(contours);
const polygons = contour.tracingPolygons(contours, anlValues);

let lineFeatures = [];
for (let i = 0; i < contours.length; i++) {
  const line = contours[i];
  const feature = uti.getFeatureOfPoints("LineString", line);
  lineFeatures.push(feature);
}

let polyFeatures = [];
for (let polygon of polygons) {
  const polyline = polygon.outLine;
  let feature = uti.getFeatureOfPoints('Polygon', polyline, anlValues, polygon);
  polyFeatures.push(feature);
}
0.1.0

3 years ago