forked from tidwall/geojson
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultipoint_test.go
More file actions
21 lines (18 loc) · 862 Bytes
/
multipoint_test.go
File metadata and controls
21 lines (18 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package geojson
import "testing"
func TestMultiPoint(t *testing.T) {
p := expectJSON(t, `{"type":"MultiPoint","coordinates":[[1,2,3]]}`, nil)
expect(t, p.Center() == P(1, 2))
expectJSON(t, `{"type":"MultiPoint","coordinates":[1,null]}`, errCoordinatesInvalid)
expectJSON(t, `{"type":"MultiPoint","coordinates":[[1,2]],"bbox":null}`, nil)
expectJSON(t, `{"type":"MultiPoint"}`, errCoordinatesMissing)
expectJSON(t, `{"type":"MultiPoint","coordinates":null}`, errCoordinatesInvalid)
expectJSON(t, `{"type":"MultiPoint","coordinates":[[1,2,3],[4,5,6]],"bbox":[1,2,3,4]}`, nil)
}
// func TestMultiPointPoly(t *testing.T) {
// p := expectJSON(t, `{"type":"MultiPoint","coordinates":[[1,2],[2,2]]}`, nil)
// expect(t, p.Intersects(PO(1, 2)))
// expect(t, p.Contains(PO(1, 2)))
// expect(t, p.Contains(PO(2, 2)))
// expect(t, !p.Contains(PO(3, 2)))
// }