* chore: init go.mod * chore: ignore go binaries * chore: remove thrift, will be managed by go mod * chore: build c++ and go in one repo * chore: depends on snappy * chore: build snappy_command * chore: compress wayid2nodeids.csv by snappy |
||
|---|---|---|
| .. | ||
| go | ||
| .gitignore | ||
| proxy.thrift | ||
| README.md | ||
OSRM Traffic Updater
The OSRM Traffic Updater is designed for pull traffic data from Traffic Proxy(Telenav) then dump to OSRM required traffic.csv. Refer to OSRM with Telenav Traffic Design and OSRM Traffic for more details.
We have implemented both Python and Go version. Both of them have same function(pull data then dump to csv), but the Go implementation is about 23 times faster than Python implementation. So strongly recommended to use Go implementation as preference.
- E.g.
6727490lines traffic of NA regionGoImplementation: about9 secondsPythonImplementation: about210 seconds
RPC Protocol
See proxy.thrift for details.
Python Implementation
The python based implementation has been deprecated due to bad performance. See Deprecated Python Implementation Codes if you'd like to see code details.
Go Implementation
Requirements
go version go1.12.5 linux/amd64thrift 0.12.0- clone
thriftfromgithub.com/apache/thrift, then checkout branch0.12.0
- clone
- change
thriftimports in generated codesgen-go/proxygit.apache.org/thrift.git/lib/go/thrift->github.com/apache/thrift/lib/go/thrift
Usage
$ cd $GOPATH
$ go install github.com/Telenav/osrm-backend/traffic_updater/go/osrm_traffic_updater
$ ./bin/osrm_traffic_updater -h
Usage of ./bin/osrm_traffic_updater:
-c string
traffic proxy ip address (default "127.0.0.1")
-d use high precision speeds, i.e. decimal. (default false)
-f string
OSRM traffic csv file (default "traffic.csv")
-m string
OSRM way id to node ids mapping table (default "wayid2nodeids.csv")
-p int
traffic proxy listening port (default 6666)
wayid2nodeids_extractor
Extract wayid to nodeids mapping from PBF
Usage
$ cd $GOPATH
$ go install github.com/Telenav/osrm-backend/traffic_updater/go/wayid2nodeid_extractor
$ ./bin/wayid2nodeid_extractor -h
Usage of ./bin/wayid2nodeid_extractor:
-b Is pbf generated by telenav internally
-i string
Input pbf file.
-o string
Output csv file