https://github.com/abdullahselek/go-here
Go client library around the HERE location based APIs.
https://github.com/abdullahselek/go-here
golang golang-client golang-library here-maps-api heremaps http-client location-based-services
Last synced: 8 months ago
JSON representation
Go client library around the HERE location based APIs.
- Host: GitHub
- URL: https://github.com/abdullahselek/go-here
- Owner: abdullahselek
- License: mit
- Created: 2019-07-07T12:14:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-23T13:20:37.000Z (over 5 years ago)
- Last Synced: 2024-07-31T20:53:18.650Z (over 1 year ago)
- Topics: golang, golang-client, golang-library, here-maps-api, heremaps, http-client, location-based-services
- Language: Go
- Homepage:
- Size: 61.5 KB
- Stars: 13
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-cn - go-here - here) [![godoc][D]](https://godoc.org/github.com/abdullahselek/go-here) (第三方api / 实用程序/Miscellaneous)
- awesome-go-extra - go-here - 07-07T12:14:34Z|2020-06-23T13:20:37Z| (Third-party APIs / Fail injection)
- awesome-go - go-here - Go client library around the HERE location based APIs. (Third-party APIs / Utility/Miscellaneous)
- fucking-awesome-go - go-here - Go client library around the HERE location based APIs. (Third-party APIs / Utility/Miscellaneous)
- awesome-go - go-here - Go client library around the HERE location based APIs. (Third-party APIs / Utility/Miscellaneous)
- awesome-go-plus - go-here - Go client library around the HERE location based APIs.  (Third-party APIs / Utility/Miscellaneous)
- awesome-go - go-here - Go client library around the HERE location based APIs. (Third-party APIs / Utility/Miscellaneous)
- awesome-go-with-stars - go-here - Go client library around the HERE location based APIs. (Third-party APIs / Utility/Miscellaneous)
- awesome-go - go-here - Go client library around the HERE location based APIs. (Third-party APIs / Utility/Miscellaneous)
- awesome-go - go-here - Go client library around the HERE location based APIs. (Third-party APIs / Utility/Miscellaneous)
- awesome-Char - go-here - Go client library around the HERE location based APIs. (Third-party APIs / HTTP Clients)
- awesome-go-cn - go-here - here) [![godoc][D]](https://godoc.org/github.com/abdullahselek/go-here) (第三方api / 实用程序/Miscellaneous)
- awesome-go - go-here - Go client library around the HERE location based APIs. (Third-party APIs / HTTP Clients)
- awesome-go-cn - go-here
README
# go-here [](https://codecov.io/gh/abdullahselek/go-here) [](https://godoc.org/github.com/abdullahselek/go-here/here) [](https://goreportcard.com/report/abdullahselek/go-here)
| Build Type | Status |
| --- | --- |
| Linux | [](https://travis-ci.org/abdullahselek/go-here) |
| Windows | [](https://ci.appveyor.com/project/abdullahselek/go-here) |
**go-here** is a Go client library for the [HERE API](https://developer.here.com). [HERE](https://www.here.com) provides location based services. HERE exposes [rest APIs](https://developer.here.com/develop/rest-apis) and this library is intended to make it even easier for Go programmers to use. Check the usage section or try the examples to see how to access the HERE API.
### Features
* HERE REST API:
* Routing
* Geocoding
* Reverse Geocoding
* Geocoding Autocomplete
* Places
Will add rest of the apis in time and all contributions are welcome.
## Install
go get github.com/abdullahselek/go-here/here
To install **go-here** and it's dependencies with a single line
go get -t github.com/abdullahselek/go-here/here
## Documentation
Read [GoDoc](https://godoc.org/github.com/abdullahselek/go-here/here)
## Usage
The `here` package provides a `Client` for accessing the HERE API and each API service requires an AppID and AppKey. Here are some example requests.
```go
var httpClient = &http.Client{
Timeout: time.Second * 15,
}
// Routing client
routingClient := here.NewRoutingClient(httpClient)
routingParams := routingClient.Routing.CreateRoutingParams([2]float32{52.5160, 13.3779}, [2]float32{52.5206, 13.3862}, "appID", []here.Enum{here.RouteMode.Fastest, here.RouteMode.Car, here.RouteMode.TrafficDefault})
routes, httpResponse, err := routingClient.Routing.Route(&routingParams)
// Finding Address in boundingbox
geocodingClient := here.NewGeocodingClient(httpClient)
addressBoundingBoxParams := here.AddressInBoundingBoxParameters{SearchText: "1 main", MapView: geocodingClient.Geocoding.CreateMapView([2]float32{42.3902, -71.1293}, [2]float32{42.3312, -71.0228}), Gen: 9, APIKey: "appKey"}
geocodingResponse, httpResponse, err := geocodingClient.Geocoding.AddressInBoundingBox(&addressBoundingBoxParams)
// Partial address information
partialAddressInformationParams := here.PartialAddressInformationParameters{HouseNumber: 425, Street: "randolph", City: "chicago", Country: "usa", Gen: 9, APIKey: "apiKey"}
geocodingResponse, httpResponse, err = geocodingClient.Geocoding.PartialAddressInformation(&partialAddressInformationParams)
// Reverse geocoding for address details
reverseGeocodingClient := here.NewReverseGeocodingClient(httpClient)
locationParameters := reverseGeocodingClient.ReverseGeocoding.CreateAddressFromLocationParameters([2]float32{42.3902, -71.1293}, 250, here.ReverseGeocodingMode.RetrieveAddresses, 1, 9, "apiKey")
geocodingResponse, httpResponse, err = reverseGeocodingClient.ReverseGeocoding.AddressFromLocation(&locationParameters)
// Reverse geocoding for landmark details
landmarkParameters := reverseGeocodingClient.ReverseGeocoding.CreateLandmarksParameters([2]float32{42.3902, -71.1293}, 1, 9, "apiKey")
geocodingResponse, httpResponse, err = reverseGeocodingClient.ReverseGeocoding.Landmarks(&landmarkParameters)
// Complete location details
autocompleteGeocodingClient := here.NewAutocompleteGeocodingClient(httpClient)
suggestionsParameters := autocompleteGeocodingClient.AutocompleteGeocoding.CreateDetailsForSuggestionParameters("Pariser 1 Berl", "apiKey")
autocompleteGeocodingResponse, httpResponse, err := autocompleteGeocodingClient.AutocompleteGeocoding.DetailsForSuggestion(&suggestionsParameters)
```
## Roadmap
* Add new clients for other endpoints.
* ~~Use parameter structs on functions.~~
## License
[MIT License](https://github.com/abdullahselek/go-here/blob/master/LICENSE)