Skip to main content
Version: Next

toMercator

Description

Converts a WGS84 GeoJSON object into Mercator (EPSG:900913) projection

Parameters

NameTypeDescription
geojsonGeoJSON | PositionWGS84 GeoJSON object
options?ObjectOptional parameters
options.mutate?booleanallows GeoJSON input to be mutated (significant performance increase if true) (default false)

Returns

Examples

var pt = turf.point([-71, 41]);
var converted = turf.toMercator(pt);

Installation

$ npm install @turf/projection

import { toMercator } from "@turf/projection";
const result = toMercator(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.toMercator(...);