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

Function EncodeGeoAscending

pkg/util/encoding/encoding.go:1355–1365  ·  view source on GitHub ↗

EncodeGeoAscending encodes a geopb.SpatialObject value in ascending 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

1353// returns the new buffer.
1354// It is sorted by the given curve index, followed by the bytes of the spatial object.
1355func EncodeGeoAscending(b []byte, curveIndex uint64, so *geopb.SpatialObject) ([]byte, error) {
1356 b = append(b, geoMarker)
1357 b = EncodeUint64Ascending(b, curveIndex)
1358
1359 data, err := protoutil.Marshal(so)
1360 if err != nil {
1361 return nil, err
1362 }
1363 b = encodeBytesAscendingWithTerminator(b, data, ascendingGeoEscapes.escapedTerm)
1364 return b, nil
1365}
1366
1367// EncodeGeoDescending encodes a geopb.SpatialObject value in descending order and
1368// returns the new buffer.

Callers

nothing calls this directly

Calls 3

MarshalFunction · 0.92
EncodeUint64AscendingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…