How to use the @turf/boolean-intersects.default function in @turf/boolean-intersects

To help you get started, we’ve selected a few @turf/boolean-intersects 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-rectangle-grid / index.js View on Github external
var deltaX = (bboxWidth - columns * cellWidthDeg) / 2;
    var deltaY = (bboxHeight - rows * cellHeightDeg) / 2;
    // iterate over columns & rows
    var currentX = west + deltaX;
    for (var column = 0; column < columns; column++) {
        var currentY = south + deltaY;
        for (var row = 0; row < rows; row++) {
            var cellPoly = helpers_1.polygon([[
                    [currentX, currentY],
                    [currentX, currentY + cellHeightDeg],
                    [currentX + cellWidthDeg, currentY + cellHeightDeg],
                    [currentX + cellWidthDeg, currentY],
                    [currentX, currentY],
                ]], options.properties);
            if (options.mask) {
                if (boolean_intersects_1.default(options.mask, cellPoly)) {
                    results.push(cellPoly);
                }
            }
            else {
                results.push(cellPoly);
            }
            currentY += cellHeightDeg;
        }
        currentX += cellWidthDeg;
    }
    return helpers_1.featureCollection(results);
}
exports.default = rectangleGrid;
github hotosm / MapCampaigner / lambda_functions / process / make_pdf_grid / index.js View on Github external
const features = []
    for (let i = 0; i < f.length; i++) {
        const box = bbox(f[i]);
        const w = distance([box[0], box[1]],[box[2],box[1]],{units:"meters"})
        const h = distance([box[0], box[1]],[box[0],box[3]],{units:"meters"})
        const wDiff = 1000 - (w % 1000);
        const hDiff = 706 - (h % 706);
        const poly = bboxPolygon(box);
        const c = centerOfMass(poly);
        const maxY = destination(c,(50 + h + hDiff)/2, 0, options).geometry.coordinates[1];
        const minY = destination(c,(50 +h + hDiff)/2, 180,options).geometry.coordinates[1];
        const maxX = destination(c,(50 + w + wDiff)/2, 90,options).geometry.coordinates[0];
        const minX = destination(c,(50 + w + wDiff)/2, -90,options).geometry.coordinates[0];
        const grid = rectangleGrid([minX, minY, maxX, maxY], 1000, 706, {units:"meters"});
        for (let j=0; j

@turf/boolean-intersects

turf boolean-intersects module

MIT
Latest version published 5 months ago

Package Health Score

94 / 100
Full package analysis

Popular @turf/boolean-intersects functions