forked from Project-OSRM/osrm-backend
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Oasis - Build spatial index for charge stations based on Google::S2 #239
Labels
Comments
Code saving: Print Cells in sorted distance func cellIDFromString(s string) s2.CellID {
level := len(s) - 2
if level < 0 || level > 30 {
return s2.CellID(0)
}
face := int(s[0] - '0')
if face < 0 || face > 5 || s[1] != '/' {
return s2.CellID(0)
}
id := s2.CellIDFromFace(face)
for i := 2; i < len(s); i++ {
childPos := s[i] - '0'
if childPos < 0 || childPos > 3 {
return s2.CellID(0)
}
id = id.Children()[childPos]
}
return id
}
keys := make([]string, 0, len(cellID2PointIDs))
for k := range cellID2PointIDs {
keys = append(keys, k.String())
}
sort.Strings(keys)
for _, kStr := range keys {
k := cellIDFromString(kStr)
fmt.Printf("%d : {", k)
for i, p := range cellID2PointIDs[k] {
if i != 0 {
fmt.Printf(",")
}
fmt.Printf("%d", p)
}
fmt.Printf("}, // %v \n", k)
} |
CodeBear801
added a commit
that referenced
this issue
Mar 24, 2020
CodeBear801
added a commit
that referenced
this issue
Mar 24, 2020
3 tasks
CodeBear801
added a commit
that referenced
this issue
Mar 30, 2020
* feat: implement spartial index query based on google::s2 issue: #239
CodeBear801
added a commit
that referenced
this issue
Apr 1, 2020
* feat: implement spatial index query based on google::s2 issue: #239
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Subtask of #231, implements #236
nearbyQuery
The text was updated successfully, but these errors were encountered: