Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: coordinates must contain numbers #2809

Open
Felankia opened this issue Jan 13, 2025 · 1 comment
Open

Error: coordinates must contain numbers #2809

Felankia opened this issue Jan 13, 2025 · 1 comment

Comments

@Felankia
Copy link

Felankia commented Jan 13, 2025

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
@petrot
Copy link

petrot commented Jan 13, 2025

Same problem here with the "nearestPointOnLine" function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants