This library lets you consume the openrouteservice API in Go applications. It allows you to painlessly consume the following services:
- Directions (routing)
- Geocoding | Reverse Geocoding | Structured Geocoding (powered by Pelias)
- Isochrones (accessibility)
- Time-distance matrix
- POIs (points of interest)
- Elevation (linestring or point)
- Optimization
See the examples in the examples folder.
Note: In order to use this client, you have to register for a token at openrouteservice. To understand the features of openrouteservice, please don't forget to read the docs. For visualization purposes on the map, please use openrouteservice maps.
This library uses the ORS API for request validation. To understand the input of each API specifically, please check the API Playground that provides interactive documentation.
- git
- go
go get github.com/sagarsubedi/openrouteservice-go
package main
import (
"github.com/sagarsubedi/openrouteservice-go"
)
func main() {
orsDirections := openrouteservice.NewOrsDirections(map[string]interface{}{
"api_key": "XYZ",
})
// ...
}
package main
import (
"github.com/sagarsubedi/openrouteservice-go"
)
func main() {
orsDirections := openrouteservice.NewOrsDirections(map[string]interface{}{
"host": "<http://localhost:8082/ors>",
})
// ...
}
git clone https://github.com/sagarsubedi/openrouteservice-go.git
cd openrouteservice-go
echo "API_KEY=your_api_key_here" > .env
To run tests, use the Go testing tool:
go test ./...
Apply the changes in a feature branch and test it locally. Once the feature is ready, merge it to develop, deploy it to the testing environment.
Checkout in main, merge from develop and use npm run release to generate a release. This will generate a new release commit as well as a git tag and an entry in CHANGELOG.md.
For more details about commitizen and standard-version, see this article.