Table of Contents

Struct MercatorPoint

Namespace
LansMap.Core.Geo

A position in normalized Web Mercator space, where the whole world is the unit square: (0,0) is the top-left corner (latitude +85.05, longitude -180) and (1,1) the bottom-right.

public readonly struct MercatorPoint : IEquatable<MercatorPoint>
Implements

Remarks

Always double, never float. At high zoom a float32 mercator coordinate cannot resolve a screen pixel, which is why world coordinates stay in double and the renderer re-anchors near the view center before handing anything to the GPU. Deliberately unvalidated: intermediate results legitimately leave the unit square when wrapping across the antimeridian.

Constructors

MercatorPoint(double, double)

Creates a mercator position. No range validation.

public MercatorPoint(double x, double y)

Parameters

x double

Horizontal position in normalized mercator, normally 0 to 1.

y double

Vertical position in normalized mercator, normally 0 to 1.

Properties

X

Horizontal position in normalized mercator, 0 at longitude -180, 1 at +180.

public double X { get; }

Property Value

double

Y

Vertical position in normalized mercator, 0 at the north edge, 1 at the south edge. Increases southward, opposite to latitude.

public double Y { get; }

Property Value

double

Methods

Equals(MercatorPoint)

Exact component-wise equality. No tolerance.

public bool Equals(MercatorPoint other)

Parameters

other MercatorPoint

Returns

bool

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns "merc(x,y)".

public override string ToString()

Returns

string