Skip to content

Commit 8c78ea6

Browse files
Document Go data ingestion (#53)
1 parent 02a711a commit 8c78ea6

File tree

8 files changed

+243
-114
lines changed

8 files changed

+243
-114
lines changed

api-reference/go/datasets/Datapoints.Ingest.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Ingest data points into a collection.
2020
<ParamField path="collectionID" type="uuid.UUID">
2121
The id of the collection
2222
</ParamField>
23-
<ParamField path="datapoints" type="[]proto.Message">
23+
<ParamField path="datapoints" type="*[]proto.Message">
2424
The datapoints to ingest
2525
</ParamField>
2626
<ParamField path="allowExisting" type="bool">
@@ -50,7 +50,7 @@ datapoints := []*v1.Modis{
5050

5151
ingestResponse, err := client.Datapoints.Ingest(ctx,
5252
collectionID,
53-
datapoints
53+
&datapoints
5454
false,
5555
)
5656
```

api-reference/go/datasets/Datapoints.Query.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ icon: layer-group
77
```go
88
func (datapointClient) Query(
99
ctx context.Context,
10-
collectionID uuid.UUID,
10+
collectionIDs []uuid.UUID,
1111
options ...datasets.QueryOption,
1212
) iter.Seq2[[]byte, error]
1313
```
1414

15-
Query a range of data points in this collection in a specified interval.
15+
Query a range of data points in the specified collections in a specified interval.
1616

1717
The datapoints are lazily queried and returned as a sequence of bytes.
1818
The output sequence can be transformed into a typed `proto.Message` using [CollectAs](/api-reference/go/datasets/CollectAs) or [As](/api-reference/go/datasets/As) functions.
1919

2020
## Parameters
2121

22-
<ParamField path="collectionID" type="uuid.UUID">
23-
The id of the collection
22+
<ParamField path="collectionIDs" type="[]uuid.UUID">
23+
The ids of the collections to query
2424
</ParamField>
2525
<ParamField path="options" type="[]datasets.QueryOption">
2626
Options for querying data points
@@ -58,7 +58,7 @@ endDate := time.Date(2021, 2, 24, 0, 0, 0, 0, time.UTC)
5858
queryInterval := query.NewTimeInterval(startDate, endDate)
5959

6060
datapoints, err := datasets.CollectAs[*v1.Sentinel1Sar](
61-
client.Datapoints.Query(ctx, collectionID, datasets.WithTemporalExtent(queryInterval)),
61+
client.Datapoints.Query(ctx, []uuid.UUID{collection.ID}, datasets.WithTemporalExtent(queryInterval)),
6262
)
6363
```
6464
</RequestExample>

api-reference/go/datasets/Datapoints.QueryInto.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ icon: layer-group
77
```go
88
func (datapointClient) QueryInto(
99
ctx context.Context,
10-
collectionID uuid.UUID,
10+
collectionIDs []uuid.UUID,
1111
datapoints any,
1212
options ...datasets.QueryOption,
1313
) error
1414
```
1515

16-
Query a range of data points in this collection in a specified interval.
16+
Query a range of data points in the specified collections in a specified interval.
1717

1818
QueryInto is a convenience function for [Query](/api-reference/go/datasets/Datapoints.Query), when no manual pagination or custom iteration is required.
1919

2020
## Parameters
2121

22-
<ParamField path="collectionID" type="uuid.UUID">
23-
The id of the collection
22+
<ParamField path="collectionIDs" type="[]uuid.UUID">
23+
The ids of the collections to query
2424
</ParamField>
25-
<ParamField path="datapoints" type="[]proto.Message">
25+
<ParamField path="datapoints" type="*[]proto.Message">
2626
The datapoints to query into
2727
</ParamField>
2828
<ParamField path="options" type="[]datasets.QueryOption">
@@ -62,7 +62,7 @@ queryInterval := query.NewTimeInterval(startDate, endDate)
6262

6363
var datapoints []*v1.Sentinel1Sar
6464
err := client.Datapoints.QueryInto(ctx,
65-
collectionID,
65+
[]uuid.UUID{collection.ID},
6666
&datapoints,
6767
datasets.WithTemporalExtent(queryInterval),
6868
)

datasets/delete.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ description: Learn how to delete data points from Tilebox datasets.
55
icon: trash-can
66
---
77

8-
import { CodeOutputHeader } from '/snippets/components.mdx';
9-
108
<Note>
119
You need to have write permission on the collection to be able to delete datapoints.
1210
</Note>
@@ -72,7 +70,6 @@ func main() {
7270
}
7371
```
7472
</CodeGroup>
75-
<CodeOutputHeader />
7673
<CodeGroup>
7774
```plaintext Output
7875
Deleted 2 data points.
@@ -126,7 +123,6 @@ if err != nil {
126123
slog.Info("Deleted data points", slog.Int64("deleted", numDeleted))
127124
```
128125
</CodeGroup>
129-
<CodeOutputHeader />
130126
<CodeGroup>
131127
```plaintext Output
132128
Deleted 104 data points.

0 commit comments

Comments
 (0)