Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}