This repository has been archived by the owner on Dec 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
pip.go
52 lines (40 loc) · 1.67 KB
/
pip.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
package pip
// would that we could have a single all-purpose geojson interface
// but since we don't necessarily know what *kind* of geometry we're
// dealing with (I mean here we do but that's not the point) it's
// not clear what we say gets returned by a Coordinates() method in
// a Geometry interface - is it really even that important? I suppose
// it would be nice to be able to have GetCandidatesByCoord return
// an interface-thingy but for now this will do (20170822/thisisaaronland)
// to whit: what is the relationship between this and all the GeoJSON
// structs in cache/utils.go... I am not sure yet (20170921/thisisaaronland)
type GeoJSONPoint []float64
type GeoJSONRing []GeoJSONPoint
type GeoJSONPolygon []GeoJSONRing
type GeoJSONMultiPolygon []GeoJSONPolygon
type GeoJSONGeometry struct {
Type string `json:"type"`
Coordinates GeoJSONMultiPolygon `json:"coordinates"`
}
type GeoJSONProperties interface{}
type GeoJSONFeature struct {
Type string `json:"type"`
Geometry GeoJSONGeometry `json:"geometry"`
Properties GeoJSONProperties `json:"properties"`
}
type GeoJSONFeatureCollection struct {
Type string `json:"type"`
Features []GeoJSONFeature `json:"features"`
Pagination Pagination `json:"pagination,omitempty"`
}
type GeoJSONFeatureCollectionSet struct {
Type string `json:"type"`
Collections []*GeoJSONFeatureCollection `json:"features"`
Pagination Pagination `json:"pagination,omitempty"`
}
type Pagination struct {
TotalCount int `json:"total_count"`
Page int `json:"page"`
PerPage int `json:"per_page"`
PageCount int `json:"page_count"`
}