Skip to content

@ue-too/border / index / inverseMercatorProjection

関数: inverseMercatorProjection()

inverseMercatorProjection(point, centerLongitude): GeoCoord

定義: projection.ts:85

Converts a Mercator projection point back to geographic coordinates.

パラメータ

point

Point

The point in Mercator projection (in meters)

centerLongitude

number = 0

The central meridian in degrees (must match the forward projection)

戻り値

GeoCoord

The geographic coordinate

Remarks

This is the inverse of mercatorProjection. Given a point in Mercator projection space (in meters), it returns the corresponding latitude/longitude.

typescript
const point = { x: -14232.4, y: 6711665.7 };
const coord = inverseMercatorProjection(point);
console.log(coord); // { latitude: ~51.5, longitude: ~-0.13 }