We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @turf/projection.toWgs84 function in @turf/projection

To help you get started, we’ve selected a few @turf/projection 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-buffer / index.js View on Github external
var buffered = BufferOp.bufferOp(geom, distance);
    var writer = new GeoJSONWriter();
    buffered = writer.write(buffered);

    // Detect if empty geometries
    if (coordsIsNaN(buffered.coordinates)) return undefined;

    // Unproject coordinates (convert to Degrees)
    var result;
    if (needsTransverseMercator) {
        result = {
            type: buffered.type,
            coordinates: unprojectCoords(buffered.coordinates, defineProjection(geometry))
        };
    } else {
        result = toWgs84(buffered);
    }

    return (result.geometry) ? result : feature(result, properties);
}

@turf/projection

Provides tools for conversion between geographic coordinates and projected coordinates.

MIT
Latest version published 23 days ago

Package Health Score

93 / 100
Full package analysis

Popular @turf/projection functions