EncodeGeoInvertedBBox encodes the bounding box for the geo inverted index.
(b []byte, loX, loY, hiX, hiY float64)
| 1069 | |
| 1070 | // EncodeGeoInvertedBBox encodes the bounding box for the geo inverted index. |
| 1071 | func 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. |
nothing calls this directly
no test coverage detected
searching dependent graphs…