示例#1
0
func TestWKBEncode(t *testing.T) {
	for _, c := range cases {
		if got, err := wkb.Decode(c.wkb); err != nil || !reflect.DeepEqual(got, c.g) {
			t.Errorf("wkb.Decode(%#v) == %#v, %#v, want %#v, nil", c.wkb, got, err, c.g)
		}
	}
}
示例#2
0
文件: hex.go 项目: romaxa/gogeom
func Decode(s string) (geom.T, error) {
	data, err := hex.DecodeString(s)
	if err != nil {
		return nil, err
	}
	return wkb.Decode(data)
}