This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreverse_geocoder.go
62 lines (51 loc) · 1.59 KB
/
reverse_geocoder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package yolp
import "net/url"
// ReverseGeocoderRequest ReverseGeocoder API request
type ReverseGeocoderRequest struct {
client *Client
Parameters GeocoderParams
}
// Query returns query parameters
func (req ReverseGeocoderRequest) Query() url.Values {
return req.Parameters.Query()
}
// HTTPMethod GET
func (req ReverseGeocoderRequest) HTTPMethod() string {
return "GET"
}
// Endpoint http://reverse.search.olp.yahooapis.jp/OpenLocalPlatform/V1/reverseGeoCoder
func (req ReverseGeocoderRequest) Endpoint() string {
return "http://reverse.search.olp.yahooapis.jp/OpenLocalPlatform/V1/reverseGeoCoder"
}
// ReverseGeocoderFeature ReverseGeocoder Feature
type ReverseGeocoderFeature struct {
Feature
Property ReverseGeocoderProperty
}
// ReverseGeocoderProperty ReverseGeocoder Property
type ReverseGeocoderProperty struct {
Country Country
Address string
AddressElement []AddressElement
Building []Building
Road []Road
}
// ReverseGeocoderResponse ReverseGeocoder API response
type ReverseGeocoderResponse struct {
YDF
Feature []ReverseGeocoderFeature
}
// ReverseGeocoder
// ReverseGeocoder requests ReverseGeocoder API
// http://developer.yahoo.co.jp/webapi/map/openlocalplatform/v1/reversegeocoder.html
func (client *Client) ReverseGeocoder(params GeocoderParams) *ReverseGeocoderRequest {
return &ReverseGeocoderRequest{client, params}
}
// Do sends request
func (req *ReverseGeocoderRequest) Do() (*ReverseGeocoderResponse, error) {
var res ReverseGeocoderResponse
if _, err := req.client.DoRequest(req, &res); err != nil {
return nil, err
}
return &res, nil
}