How to use the @turf/union.apply function in @turf/union

To help you get started, we’ve selected a few @turf/union examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Turfjs / turf / packages / turf-mask / index.js View on Github external
while (true) {
            var bbox = turfBBox(currentFeature);
            var search = tree.search({
                minX: bbox[0],
                minY: bbox[1],
                maxX: bbox[2],
                maxY: bbox[3]
            });
            if (search.length > 0) {
                var polys = search.map(function (item) {
                    removed[item.index] = true;
                    tree.remove({index: item.index}, filterByIndex);
                    return item.geojson;
                });
                polys.push(currentFeature);
                currentFeature = union.apply(this, polys);
            }
            // Done
            if (search.length === 0) break;
        }
        results.push(currentFeature);
    });

@turf/union

turf union module

MIT
Latest version published 3 months ago

Package Health Score

96 / 100
Full package analysis

Popular @turf/union functions