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

Function EncodeGeoDescending

pkg/util/encoding/encoding.go:1370–1382  ·  view source on GitHub ↗

EncodeGeoDescending encodes a geopb.SpatialObject value in descending order and returns the new buffer. It is sorted by the given curve index, followed by the bytes of the spatial object.

(b []byte, curveIndex uint64, so *geopb.SpatialObject)

Source from the content-addressed store, hash-verified

1368// returns the new buffer.
1369// It is sorted by the given curve index, followed by the bytes of the spatial object.
1370func EncodeGeoDescending(b []byte, curveIndex uint64, so *geopb.SpatialObject) ([]byte, error) {
1371 b = append(b, geoDescMarker)
1372 b = EncodeUint64Descending(b, curveIndex)
1373
1374 data, err := protoutil.Marshal(so)
1375 if err != nil {
1376 return nil, err
1377 }
1378 n := len(b)
1379 b = encodeBytesAscendingWithTerminator(b, data, ascendingGeoEscapes.escapedTerm)
1380 onesComplement(b[n:])
1381 return b, nil
1382}
1383
1384// DecodeGeoAscending decodes a geopb.SpatialObject value that was encoded
1385// in ascending order back into a geopb.SpatialObject. The so parameter

Callers

nothing calls this directly

Calls 4

MarshalFunction · 0.92
EncodeUint64DescendingFunction · 0.85
onesComplementFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…