DecodeGeoDescending decodes a geopb.SpatialObject value that was encoded in descending order back into a geopb.SpatialObject. The so parameter must already be empty/reset.
(b []byte, so *geopb.SpatialObject)
| 1410 | // in descending order back into a geopb.SpatialObject. The so parameter |
| 1411 | // must already be empty/reset. |
| 1412 | func DecodeGeoDescending(b []byte, so *geopb.SpatialObject) ([]byte, error) { |
| 1413 | if PeekType(b) != GeoDesc { |
| 1414 | return nil, errors.Errorf("did not find Geo marker") |
| 1415 | } |
| 1416 | b = b[1:] |
| 1417 | var err error |
| 1418 | b, _, err = DecodeUint64Descending(b) |
| 1419 | if err != nil { |
| 1420 | return nil, err |
| 1421 | } |
| 1422 | |
| 1423 | var pbBytes []byte |
| 1424 | b, pbBytes, err = decodeBytesInternal(b, pbBytes, descendingGeoEscapes, false /* expectMarker */, false /* deepCopy */) |
| 1425 | if err != nil { |
| 1426 | return b, err |
| 1427 | } |
| 1428 | onesComplement(pbBytes) |
| 1429 | // Not using protoutil.Unmarshal since the call to so.Reset() will waste the |
| 1430 | // pre-allocated EWKB. |
| 1431 | err = so.Unmarshal(pbBytes) |
| 1432 | return b, err |
| 1433 | } |
| 1434 | |
| 1435 | // EncodeTimeTZAscending encodes a timetz.TimeTZ value and appends it to |
| 1436 | // the supplied buffer and returns the final buffer. |
nothing calls this directly
no test coverage detected
searching dependent graphs…