twelch on type-cleanup-1
prettier (compare)
twelch on type-cleanup-1
featureEach: add properties gen… (compare)
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'
function orientation(n) {
var pos = []
var neg = []
var m = matrix(n)
var args = []
for(var i=0; i<n; ++i) {
if((i&1)===0) {
pos.push.apply(pos, determinant(cofactor(m, i)))
} else {
neg.push.apply(neg, determinant(cofactor(m, i)))
}
args.push("m" + i)
}
var posExpr = generateSum(pos)
var negExpr = generateSum(neg)
var funcName = "orientation" + n + "Exact"
var code = ["function ", funcName, "(", args.join(), "){var p=", posExpr, ",n=", negExpr, ",d=sub(p,n);\
return d[d.length-1];};return ", funcName].join("")
var proc = new Function("sum", "prod", "scale", "sub", code)
return proc(robustSum, twoProduct, robustScale, robustSubtract)
}
Hi, hoping for some help with insersect package. Getting the 'found non-noded intersection between LINESTRING' error. If you look at one of the polygons with issue, there is a dangling line that I think is causing.
@fugwenna I think I tried that without success.
I need to check if points and linestrings are within a polygon.
I ended up using this: http://turfjs.org/docs#booleanPointInPolygon
And a hack to make each end of a linestring become a point.
The draback is that I need to check thousands of points, one at a time, with a loop.
Hey all, Im looking for answer for this question https://stackoverflow.com/questions/49645333/turfjs-linesplit-not-working-properly-when-splitter-is-near-vertex-point
I really need a help at the moment.
Thanks in advanced
Hi all. I need to count how many occurences (point) in a set of polygons by remarking the each occurences property in polygon.
The polygon is:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": 0,
"properties": {
"id": 1,
"occurences": 0
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
109.914952,
-7.19584
],
[... about 50.000 nodes ...]
]
]
}
},
[... less than 100 polygons ...]
]
}
and the points:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": 0,
"properties": {
"id": 1
},
"geometry": {
"type": "Point",
"coordinates": [
109.912194,
-7.711743
]
}
},
[... about 20.000 points ...]
]
}
In Turf.js, I believe I can do it with pointsWithinPolygon or booleanPointInPolygon. My questions are: which is faster/efficient? How to do it?
Much obliged for your attention.