Skip to content

Error: coordinates must contain numbers #2809

@Felankia

Description

@Felankia

Version: 7.2.0

Code:

let line = {}; //GeoJSON contant in [https://github.com/user-attachments/files/18392267/geojson.txt]
line = turf.cleanCoords(line);
let grid = turf.polygon([[[105.82001,38.30005],[105.87001,38.30005],[105.87001,38.350049999999996],[105.82001,38.350049999999996],[105.82001,38.30005]]])
turf.lineSplit(line, grid);

Stacktrace:

Error: coordinates must contain numbers
    at point (../node_modules/@turf/helpers/dist/cjs/index.cjs:78:11)
    at ../node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs:69:40
    at../node_modules/@turf/meta/dist/cjs/index.cjs:255:13
    at geomEach (../node_modules/@turf/meta/dist/cjs/index.cjs:197:15)
    at flattenEach (../node_modules/@turf/meta/dist/cjs/index.cjs:248:3)
    at nearestPointOnLine (../node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs:42:21)
    at ../node_modules/@turf/turf/node_modules/@turf/line-split/dist/cjs/index.cjs:112:53
    at featureEach (../node_modules/@turf/meta/dist/cjs/index.cjs:148:11)
    at findClosestFeature (../node_modules/@turf/turf/node_modules/@turf/line-split/dist/cjs/index.cjs:111:21)
    at ../node_modules/@turf/turf/node_modules/@turf/line-split/dist/cjs/index.cjs:56:27

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions