-
Notifications
You must be signed in to change notification settings - Fork 1
/
whosonfirst.go
49 lines (37 loc) · 911 Bytes
/
whosonfirst.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
package placetypes
import (
"context"
"fmt"
)
const WHOSONFIRST_DEFINITION_SCHEME string = "whosonfirst"
type WhosOnFirstDefinition struct {
Definition
spec *WOFPlacetypeSpecification
prop string
uri string
}
func init() {
ctx := context.Background()
RegisterDefinition(ctx, "whosonfirst", NewWhosOnFirstDefinition)
}
func NewWhosOnFirstDefinition(ctx context.Context, uri string) (Definition, error) {
spec, err := DefaultWOFPlacetypeSpecification()
if err != nil {
return nil, fmt.Errorf("Failed to create default WOF placetype specification, %w", err)
}
s := &WhosOnFirstDefinition{
spec: spec,
prop: "wof:placetype",
uri: uri,
}
return s, nil
}
func (s *WhosOnFirstDefinition) Specification() *WOFPlacetypeSpecification {
return s.spec
}
func (s *WhosOnFirstDefinition) Property() string {
return s.prop
}
func (s *WhosOnFirstDefinition) URI() string {
return s.uri
}