Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong coordinates returned from S2CellId#ToLatLng? #7

Open
ST-Apps opened this issue Aug 15, 2016 · 1 comment
Open

Wrong coordinates returned from S2CellId#ToLatLng? #7

ST-Apps opened this issue Aug 15, 2016 · 1 comment

Comments

@ST-Apps
Copy link

ST-Apps commented Aug 15, 2016

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?

@dkuzhanov
Copy link

I'm facing the same problem. C2 cells end up overlapping or having gaps.

I can reproduce the issue but so far had no luck fixing it. I thought that this is my logic mocking with coordinates and changes precision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants