TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Google’s S2, geometry on the sphere, cells and Hilbert curve

166 pointsby peronealmost 10 years ago

8 comments

jacobolusalmost 10 years ago
The linked presentation slides give a bit better explanation IMO: <a href="https:&#x2F;&#x2F;docs.google.com&#x2F;presentation&#x2F;d&#x2F;1Hl4KapfAENAOf4gv-pSngKwvS_jwNVHRPZTTDzXXn6Q&#x2F;view?pli=1" rel="nofollow">https:&#x2F;&#x2F;docs.google.com&#x2F;presentation&#x2F;d&#x2F;1Hl4KapfAENAOf4gv-pSn...</a><p>Too bad there aren’t more general docs for the library.<p>I still don’t quite understand the benefit of using a single number instead of a pair of numbers for describing a cell in a two-dimensional space. Seems like a pair of 32-bit fixed point numbers would be just as descriptive as a single double-precision float along the hilbert curve.<p>The way they project the sphere onto a cube also leads to cell shapes that aren’t especially relevant to typical human purposes, whereas there are many shapes on a map which align with the latitude&#x2F;longitude grid.
评论 #10067055 未加载
评论 #10067031 未加载
评论 #10067042 未加载
dnauticsalmost 10 years ago
Correct me if I&#x27;m wrong but isn&#x27;t locality unidirectional? Two close points in the plane might by chance be encoded far away on the line if they&#x27;re unluckily next to a seam.
评论 #10067699 未加载
评论 #10067695 未加载
wfunctionalmost 10 years ago
Would someone please explain to me how you one convert between the 1D and 2D coordinates of a Hilbert curve? Is there a formula for it? The drawings look nice but they don&#x27;t tell you how to actually do the conversion, which seems to be the crucial piece of the data structure.
评论 #10067102 未加载
评论 #10067198 未加载
评论 #10067410 未加载
评论 #10067696 未加载
评论 #10067025 未加载
评论 #10067023 未加载
评论 #10067036 未加载
crazy1vanalmost 10 years ago
Is it faster for spatial queries to store the S2 cells in a Btree index in a database like the article mentions or to just use something like PostGIS with its gist spatial indices -- specifically, for determining whether points are inside or outside of a polygon?
eveningcoffeealmost 10 years ago
I think this is also a great example how Google abandoning the Google Code will affect the availability of previously published work.<p>What I want to tell is that this library is not (yet according to some googling) migrated to the new platform even when it is from people from Google.
jkotalmost 10 years ago
There is also Healpix and other libraries
dsymondsalmost 10 years ago
There&#x27;s also a Go port of S2: <a href="http:&#x2F;&#x2F;godoc.org&#x2F;github.com&#x2F;golang&#x2F;geo&#x2F;s2" rel="nofollow">http:&#x2F;&#x2F;godoc.org&#x2F;github.com&#x2F;golang&#x2F;geo&#x2F;s2</a>
评论 #10067756 未加载
thrownaway2424almost 10 years ago
<a href="http:&#x2F;&#x2F;webcache.googleusercontent.com&#x2F;search?q=cache:AhGDevVVT_MJ:blog.christianperone.com&#x2F;%3Fp%3D2840&amp;hl=en&amp;gl=us&amp;strip=1&amp;vwsrc=0" rel="nofollow">http:&#x2F;&#x2F;webcache.googleusercontent.com&#x2F;search?q=cache:AhGDevV...</a>
评论 #10066810 未加载