Skip to content

Document Go data ingestion #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api-reference/go/datasets/Datapoints.Ingest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Ingest data points into a collection.
<ParamField path="collectionID" type="uuid.UUID">
The id of the collection
</ParamField>
<ParamField path="datapoints" type="[]proto.Message">
<ParamField path="datapoints" type="*[]proto.Message">
The datapoints to ingest
</ParamField>
<ParamField path="allowExisting" type="bool">
Expand Down Expand Up @@ -50,7 +50,7 @@ datapoints := []*v1.Modis{

ingestResponse, err := client.Datapoints.Ingest(ctx,
collectionID,
datapoints
&datapoints
false,
)
```
Expand Down
10 changes: 5 additions & 5 deletions api-reference/go/datasets/Datapoints.Query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ icon: layer-group
```go
func (datapointClient) Query(
ctx context.Context,
collectionID uuid.UUID,
collectionIDs []uuid.UUID,
options ...datasets.QueryOption,
) iter.Seq2[[]byte, error]
```

Query a range of data points in this collection in a specified interval.
Query a range of data points in the specified collections in a specified interval.

The datapoints are lazily queried and returned as a sequence of bytes.
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.

## Parameters

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

datapoints, err := datasets.CollectAs[*v1.Sentinel1Sar](
client.Datapoints.Query(ctx, collectionID, datasets.WithTemporalExtent(queryInterval)),
client.Datapoints.Query(ctx, []uuid.UUID{collection.ID}, datasets.WithTemporalExtent(queryInterval)),
)
```
</RequestExample>
12 changes: 6 additions & 6 deletions api-reference/go/datasets/Datapoints.QueryInto.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ icon: layer-group
```go
func (datapointClient) QueryInto(
ctx context.Context,
collectionID uuid.UUID,
collectionIDs []uuid.UUID,
datapoints any,
options ...datasets.QueryOption,
) error
```

Query a range of data points in this collection in a specified interval.
Query a range of data points in the specified collections in a specified interval.

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

## Parameters

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

var datapoints []*v1.Sentinel1Sar
err := client.Datapoints.QueryInto(ctx,
collectionID,
[]uuid.UUID{collection.ID},
&datapoints,
datasets.WithTemporalExtent(queryInterval),
)
Expand Down
4 changes: 0 additions & 4 deletions datasets/delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ description: Learn how to delete data points from Tilebox datasets.
icon: trash-can
---

import { CodeOutputHeader } from '/snippets/components.mdx';

<Note>
You need to have write permission on the collection to be able to delete datapoints.
</Note>
Expand Down Expand Up @@ -72,7 +70,6 @@ func main() {
}
```
</CodeGroup>
<CodeOutputHeader />
<CodeGroup>
```plaintext Output
Deleted 2 data points.
Expand Down Expand Up @@ -126,7 +123,6 @@ if err != nil {
slog.Info("Deleted data points", slog.Int64("deleted", numDeleted))
```
</CodeGroup>
<CodeOutputHeader />
<CodeGroup>
```plaintext Output
Deleted 104 data points.
Expand Down
Loading