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

When calculating whether a point is in a polygon area, the calculation result will be wrong #2568

Open
M-xiansen opened this issue Jan 15, 2024 · 1 comment

Comments

@M-xiansen
Copy link

M-xiansen commented Jan 15, 2024

(计算点是否在多边形区域里,计算结果会出错)

var polygon = turf.polygon([[
[85.2, 42.2],
[-173, 42.2],
[-173, 7.5],
[85.2, 7.5],
[85.2, 42.2]
]]);
var point = turf.point([122, 13]);
let bool = turf.booleanPointInPolygon(point, polygon);
The point should be in the area, but the result is (点应该是在区域里的,但是结果是) false

@smallsaucepan smallsaucepan changed the title 计算点是否在多边形区域里,计算结果会出错 When calculating whether a point is in a polygon area, the calculation result will be wrong Jan 16, 2024
@M-xiansen
Copy link
Author

add

"@turf/turf": "^6.5.0",

import * as turf from "@turf/turf"

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

No branches or pull requests

2 participants