/
struct.go
35 lines (28 loc) · 927 Bytes
/
struct.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
package geospatial
import "go.mongodb.org/mongo-driver/bson"
type GeoBorder struct {
Type string `bson:"type"`
Coordinates [][][]float64 `bson:"coordinates"`
}
type LocationData struct {
ID string `bson:"_id"`
Province string `bson:"province"`
District string `bson:"district"`
SubDistrict string `bson:"sub_district"`
Village string `bson:"village"`
Border GeoBorder `bson:"border"`
}
type RequestGeoIntersects struct {
Coordinates [][][]float64 `bson:"coordinates" json:"coordinates"`
}
type Nearspherereq struct {
Radius int `bson:"radius" json:"radius"`
Coordinates []float64 `bson:"coordinates" json:"coordinates"`
}
type GeoBoxReq struct {
LowerLeft []float64 `json:"lowerLeft" bson:"lowerLeft"`
LowerRight []float64 `json:"lowerRight" bson:"lowerRight"`
}
type Geometryreq struct {
Geometry bson.M `json:"geometry" bson:"geometry"`
}