Skip to content

Wrong coordinates returned from S2CellId#ToLatLng? #7

@ST-Apps

Description

@ST-Apps

I need to extract Lat/Lng coordinates from a given CellId, but I'm having a slight difference netween the returned values and the correct ones, and I can't understand why.

The original coordinates are

47.678956162876,-122.12871664749933

while the CellId is

6093384589483442176

What I get back is

47.72217122031298,-122.12705319813203

Here's a little snippet of my code:

var cellId = new S2CellId(CellId).ToLatLng();            
return new Geopoint(new BasicGeoposition() {Latitude = cellId.LatDegrees, Longitude = cellId.LngDegrees})

Am I doing something wrong or is there an issue when converting back to Lat/Lng?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions