Skip to content

Creating a polygon with empty array of LinearRings doesn't throw an error #1817

@daniel-hauser

Description

@daniel-hauser

Creating a polygon with empty array of LinearRings doesn't throw an error

const { polygon } = require('@turf/helpers');
console.log(polygon([]).geometry) // {coordinates: [], type: "Polygon"}

Expected: an error is thrown
Actual: returns a valid polygon with empty coordinates

  • Snippet of source code or for complex examples use jsfiddle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions