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

Function DecodeBox2DDescending

pkg/util/encoding/encoding.go:1325–1350  ·  view source on GitHub ↗

DecodeBox2DDescending decodes a box2D object in descending order.

(b []byte)

Source from the content-addressed store, hash-verified

1323
1324// DecodeBox2DDescending decodes a box2D object in descending order.
1325func DecodeBox2DDescending(b []byte) ([]byte, geopb.BoundingBox, error) {
1326 box := geopb.BoundingBox{}
1327 if PeekType(b) != Box2D {
1328 return nil, box, errors.Errorf("did not find Box2D marker")
1329 }
1330
1331 b = b[1:]
1332 var err error
1333 b, box.LoX, err = DecodeFloatDescending(b)
1334 if err != nil {
1335 return nil, box, err
1336 }
1337 b, box.HiX, err = DecodeFloatDescending(b)
1338 if err != nil {
1339 return nil, box, err
1340 }
1341 b, box.LoY, err = DecodeFloatDescending(b)
1342 if err != nil {
1343 return nil, box, err
1344 }
1345 b, box.HiY, err = DecodeFloatDescending(b)
1346 if err != nil {
1347 return nil, box, err
1348 }
1349 return b, box, nil
1350}
1351
1352// EncodeGeoAscending encodes a geopb.SpatialObject value in ascending order and
1353// returns the new buffer.

Callers

nothing calls this directly

Calls 3

PeekTypeFunction · 0.85
DecodeFloatDescendingFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…