forked from Project-OSRM/osrm-backend
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement the tool of place connectivity generator.
issue: #238
- Loading branch information
1 parent
4c65cb0
commit 6a6ef8d
Showing
4 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Package main contains the tool of chargestation-connectivity generator | ||
// | ||
// stage 1: | ||
// inputs is json file | ||
// => convert to slice of [id:string,location: lat,lon] | ||
// => calculate cellids for each point(for all levels) | ||
// => build revese index for cellID -> ids | ||
// | ||
// stage 2: | ||
// => iterate each point | ||
// => generate a circle(s2::cap), find all cellids intersect with that circle | ||
// => retrieve all ids | ||
// => generate result of id(from), ids(all ids in certain distance) | ||
// | ||
// stage 3: | ||
// => load data from file | ||
// => for each line, its formid and all other ids | ||
// => calculate distance between fromid and all other ids | ||
// => sort result based on distance and write back to file | ||
// | ||
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package main | ||
|
||
import "flag" | ||
|
||
var flags struct { | ||
inputPath string | ||
outputFolder string | ||
} | ||
|
||
func init() { | ||
flag.StringVar(&flags.inputPath, "i", "", "path for input file in json format") | ||
flag.StringVar(&flags.outputFolder, "o", "", "path for output folder") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
func main() { | ||
// @todo: add logic to generate connectivity for charge stations | ||
fmt.Print("Hello World!") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters