How to use the @turf/nearest function in @turf/nearest

To help you get started, we’ve selected a few @turf/nearest 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-point-on-surface / index.js View on Github external
properties: {}
            };
            if (inside(cent, f)) {
                onSurface = true;
            }
        }
        i++;
    }
    if (onSurface) {
        return cent;
    } else {
        var vertices = featureCollection([]);
        for (i = 0; i < fc.features.length; i++) {
            vertices.features = vertices.features.concat(explode(fc.features[i]).features);
        }
        return nearest(cent, vertices);
    }
}

@turf/nearest

turf nearest module

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis

Popular @turf/nearest functions