|
| 1 | +--- |
| 2 | +title: Client.Datapoints.Load |
| 3 | +icon: layer-group |
| 4 | +--- |
| 5 | + |
| 6 | +```go |
| 7 | +client.Datapoints.Load( |
| 8 | + ctx context.Context, |
| 9 | + collectionID uuid.UUID, |
| 10 | + interval interval.LoadInterval, |
| 11 | + options ...LoadOption, |
| 12 | +) iter.Seq2[[]byte, error] |
| 13 | +``` |
| 14 | + |
| 15 | +Load a range of data points in this collection in a specified interval. |
| 16 | + |
| 17 | +The datapoints are loaded in a lazy manner, and returned as a sequence of bytes. |
| 18 | +The output sequence can be transformed into a typed `proto.Message` using `CollectAs` or `As` functions. |
| 19 | + |
| 20 | +## Parameters |
| 21 | + |
| 22 | +<ParamField path="collectionID" type="uuid.UUID"> |
| 23 | + The id of the collection |
| 24 | +</ParamField> |
| 25 | +<ParamField path="interval" type="interval.LoadInterval"> |
| 26 | + The interval for which to load data points |
| 27 | +</ParamField> |
| 28 | +<ParamField path="options" type="[]LoadOption"> |
| 29 | + Options for loading data points |
| 30 | +</ParamField> |
| 31 | + |
| 32 | +## Returns |
| 33 | + |
| 34 | +A sequence of bytes containing the requested data points as bytes. |
| 35 | + |
| 36 | +<RequestExample> |
| 37 | +```go Go |
| 38 | +import ( |
| 39 | + "time" |
| 40 | + "github.com/tilebox/tilebox-go/interval" |
| 41 | + datasets "github.com/tilebox/tilebox-go/datasets/v1" |
| 42 | +) |
| 43 | + |
| 44 | +startDate := time.Date(2014, 10, 4, 0, 0, 0, 0, time.UTC) |
| 45 | +endDate := time.Date(2021, 2, 24, 0, 0, 0, 0, time.UTC) |
| 46 | +loadInterval := interval.NewStandardTimeInterval(startDate, endDate) |
| 47 | + |
| 48 | +datapoints, err := datasets.CollectAs[*tileboxv1.Sentinel1Sar]( |
| 49 | + client.Datapoints.Load(ctx, collectionID, loadInterval), |
| 50 | +) |
| 51 | +``` |
| 52 | +</RequestExample> |
0 commit comments