contour-rs
Computes isorings and contour polygons by applying marching squares to a rectangular array of numeric values.
Outputs ring coordinates or polygons contours as a Vec
of GeoJSON Features.
Note : This is a port of d3-contour.
The API exposes:
- a
countour_rings
function, which computes isorings coordinates for one threshold value (returns aVec
of rings coordinates). - a
ContourBuilder
struct, which computes isorings coordinates for aVec
of threshold values and transform them inMultiPolygon
s (returns aVec
of GeoJSON Features).
Example:
let c = new; // x dim., y dim., smoothing
let res = c.contours; // values, thresholds
Output:
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.