Skip to main content
func (datapointClient) QueryPage(
    ctx context.Context,
    datasetID uuid.UUID,
    options ...datasets.QueryOption,
) (*datasets.DatapointPage, error)
Query a single page of datapoints from one or more collections of the same dataset. Use QueryPage when you need manual pagination. Use Datapoints.Query for automatic lazy pagination.

Parameters

datasetID
uuid.UUID
required
The ID of the dataset to query.
options
[]datasets.QueryOption
Options for querying datapoints.

Options

datasets.WithTemporalExtent(temporalExtent query.TemporalExtent)
required
Specify the time or datapoint ID interval to query.
datasets.WithSpatialExtent(spatialExtent orb.Geometry)
Specify the geographical extent to query.
datasets.WithSpatialExtentFilter(spatialExtent query.SpatialExtent)
Specify a geographical extent with an explicit spatial filter mode and coordinate system.
datasets.WithCollections(collections ...*datasets.Collection)
Restrict the query to specific dataset collections by collection object.
datasets.WithCollectionIDs(collectionIDs ...uuid.UUID)
Restrict the query to specific dataset collections by collection ID.
datasets.WithSkipData()
default:"false"
Skip datapoint data and return only required and generated fields.
datasets.WithCursor(cursor *datasets.Cursor)
Start the query after the cursor returned by a previous page.
datasets.WithLimit(limit int64)
Limit the number of datapoints returned in this page.

Returns

A DatapointPage with raw protobuf datapoints in Datapoints and an optional NextCursor for the next page.
page, err := client.Datapoints.QueryPage(ctx,
    dataset.ID,
    datasets.WithTemporalExtent(queryInterval),
    datasets.WithCollectionIDs(collection.ID),
    datasets.WithLimit(100),
)
if err != nil {
    return err
}

if page.NextCursor != nil {
    nextPage, err := client.Datapoints.QueryPage(ctx,
        dataset.ID,
        datasets.WithTemporalExtent(queryInterval),
        datasets.WithCollectionIDs(collection.ID),
        datasets.WithCursor(page.NextCursor),
        datasets.WithLimit(100),
    )
    _ = nextPage
    _ = err
}