MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / DecodeBox2DAscending

Function DecodeBox2DAscending

pkg/util/encoding/encoding.go:1297–1322  ·  view source on GitHub ↗

DecodeBox2DAscending decodes a box2D object in ascending order.

(b []byte)

Source from the content-addressed store, hash-verified

1295
1296// DecodeBox2DAscending decodes a box2D object in ascending order.
1297func DecodeBox2DAscending(b []byte) ([]byte, geopb.BoundingBox, error) {
1298 box := geopb.BoundingBox{}
1299 if PeekType(b) != Box2D {
1300 return nil, box, errors.Errorf("did not find Box2D marker")
1301 }
1302
1303 b = b[1:]
1304 var err error
1305 b, box.LoX, err = DecodeFloatAscending(b)
1306 if err != nil {
1307 return nil, box, err
1308 }
1309 b, box.HiX, err = DecodeFloatAscending(b)
1310 if err != nil {
1311 return nil, box, err
1312 }
1313 b, box.LoY, err = DecodeFloatAscending(b)
1314 if err != nil {
1315 return nil, box, err
1316 }
1317 b, box.HiY, err = DecodeFloatAscending(b)
1318 if err != nil {
1319 return nil, box, err
1320 }
1321 return b, box, nil
1322}
1323
1324// DecodeBox2DDescending decodes a box2D object in descending order.
1325func DecodeBox2DDescending(b []byte) ([]byte, geopb.BoundingBox, error) {

Callers

nothing calls this directly

Calls 3

PeekTypeFunction · 0.85
DecodeFloatAscendingFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…