DecodeGeoAscending decodes a geopb.SpatialObject value that was encoded in ascending order back into a geopb.SpatialObject. The so parameter must already be empty/reset.
(b []byte, so *geopb.SpatialObject)
| 1385 | // in ascending order back into a geopb.SpatialObject. The so parameter |
| 1386 | // must already be empty/reset. |
| 1387 | func DecodeGeoAscending(b []byte, so *geopb.SpatialObject) ([]byte, error) { |
| 1388 | if PeekType(b) != Geo { |
| 1389 | return nil, errors.Errorf("did not find Geo marker") |
| 1390 | } |
| 1391 | b = b[1:] |
| 1392 | var err error |
| 1393 | b, _, err = DecodeUint64Ascending(b) |
| 1394 | if err != nil { |
| 1395 | return nil, err |
| 1396 | } |
| 1397 | |
| 1398 | var pbBytes []byte |
| 1399 | b, pbBytes, err = decodeBytesInternal(b, pbBytes, ascendingGeoEscapes, false /* expectMarker */, false /* deepCopy */) |
| 1400 | if err != nil { |
| 1401 | return b, err |
| 1402 | } |
| 1403 | // Not using protoutil.Unmarshal since the call to so.Reset() will waste the |
| 1404 | // pre-allocated EWKB. |
| 1405 | err = so.Unmarshal(pbBytes) |
| 1406 | return b, err |
| 1407 | } |
| 1408 | |
| 1409 | // DecodeGeoDescending decodes a geopb.SpatialObject value that was encoded |
| 1410 | // in descending order back into a geopb.SpatialObject. The so parameter |
nothing calls this directly
no test coverage detected
searching dependent graphs…