Skip to content

@turf/isobands generates wrong inner circle #2999

@linza

Description

@linza

I'm trying to use isobands, but sometime got incorrect result.
Example:
Cyan (985) polygon expected to be one polygon with hole, but it generated two polygons without holes.
Image
Image

Grid points:
Image
Code for reproduce:

  fetch("../point.json")
      .then((res) => res.text())
      .then((text) => {
        const pointGrid = JSON.parse(text);
        const breaks = [
          965, 970, 975, 980, 985, 990, 995, 1000, 1005, 1010, 1015, 1020, 1025,
          1030, 1035, 1040,
        ];
        let result = turf.isobands(pointGrid, breaks, {
          zProperty: "value",
        });
        console.log(result);
      });

If manualy replace two polygons with one, it turns out well.

 result.features[4].geometry.coordinates = [[result.features[4].geometry.coordinates[1][0], result.features[4].geometry.coordinates[0][0]]]    
Image

My raw data attached
point.json
isobands.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions