Update README
This commit is contained in:
parent
98cd890766
commit
c001587877
1 changed files with 55 additions and 3 deletions
58
README.md
58
README.md
|
@ -8,7 +8,7 @@ This step extracts bounding boxes for populated places from the OS Open Names d
|
||||||
|
|
||||||
go run ./cmd/save-gob/... opname_csv_gb.zip ./pkg/placenames/placenames.bin
|
go run ./cmd/save-gob/... opname_csv_gb.zip ./pkg/placenames/placenames.bin
|
||||||
|
|
||||||
I have included a the compiled extract in this repository so you can skip this step.
|
I have included a compiled extract in this repository so you can skip this step.
|
||||||
|
|
||||||
## Binary embedding
|
## Binary embedding
|
||||||
|
|
||||||
|
@ -16,14 +16,66 @@ We use [mule](https://github.com/wlbr/mule) to embed the gob data in the compile
|
||||||
|
|
||||||
go get github.com/wlbr/mule
|
go get github.com/wlbr/mule
|
||||||
|
|
||||||
Make sure the `mule` command is on you PATH before running `go generate`.
|
Make sure the `mule` command is on your PATH before running `go generate`.
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
mudir -p bin
|
mkdir -p bin
|
||||||
go generate ./...
|
go generate ./...
|
||||||
go build -o bin ./...
|
go build -o bin ./...
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### analyze-gpx
|
||||||
|
|
||||||
|
To analyze a single GPX track:
|
||||||
|
|
||||||
|
./bin/analyze-gpx FILENAME
|
||||||
|
|
||||||
|
This will write a JSON summary to STDOUT.
|
||||||
|
|
||||||
|
To analyze an entire directory:
|
||||||
|
|
||||||
|
./bin/analyze-gpx DIRNAME
|
||||||
|
|
||||||
|
This will scan the directory and, for each file with suffix `.gpx`, will output the analysis to a corresponding file with suffix `.json`.
|
||||||
|
|
||||||
|
### serve-rwgps
|
||||||
|
|
||||||
|
This will start a small server to analyze [RideWithGPS](https://ridewithgps.com/) tracks.
|
||||||
|
|
||||||
|
./bin/serve-rwgps
|
||||||
|
|
||||||
|
It defaults to listening on port 8000, override by setting the `LISTEN_ADDR` environment variable:
|
||||||
|
|
||||||
|
LISTEN_ADDR=127.0.0.1:3000 ./bin/serve-rwgps
|
||||||
|
|
||||||
|
Then to query a route:
|
||||||
|
|
||||||
|
curl http://localhost:3000/rwgps?routeId=30165378
|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
Contains OS data © Crown copyright and database right 2018
|
Contains OS data © Crown copyright and database right 2018
|
||||||
|
|
||||||
|
## MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 Raymond Miller
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
Loading…
Reference in a new issue