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

Function EncodeGeoInvertedBBox

pkg/util/encoding/encoding.go:1071–1085  ·  view source on GitHub ↗

EncodeGeoInvertedBBox encodes the bounding box for the geo inverted index.

(b []byte, loX, loY, hiX, hiY float64)

Source from the content-addressed store, hash-verified

1069
1070// EncodeGeoInvertedBBox encodes the bounding box for the geo inverted index.
1071func EncodeGeoInvertedBBox(b []byte, loX, loY, hiX, hiY float64) []byte {
1072 encodeTwoFloats := loX == hiX && loY == hiY
1073 if encodeTwoFloats {
1074 b = append(b, byte(geoInvertedTwoFloats))
1075 b = EncodeUntaggedFloatValue(b, loX)
1076 b = EncodeUntaggedFloatValue(b, loY)
1077 } else {
1078 b = append(b, byte(geoInvertedFourFloats))
1079 b = EncodeUntaggedFloatValue(b, loX)
1080 b = EncodeUntaggedFloatValue(b, loY)
1081 b = EncodeUntaggedFloatValue(b, hiX)
1082 b = EncodeUntaggedFloatValue(b, hiY)
1083 }
1084 return b
1085}
1086
1087// DecodeGeoInvertedKey decodes the bounding box from the geo inverted key.
1088// The cellid is skipped in the decoding.

Callers

nothing calls this directly

Calls 1

EncodeUntaggedFloatValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…