Skip to main content
func (datapointClient) Query(
    ctx context.Context,
    collectionIDs []uuid.UUID,
    options ...datasets.QueryOption,
) iter.Seq2[[]byte, error]
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 or As functions.

Parameters

collectionIDs
[]uuid.UUID
The ids of the collections to query
options
[]datasets.QueryOption
Options for querying data points

Options

WithTemporalExtent(temporalExtent query.TemporalExtent)
required
Specify the time interval for which data should be queried. Right now, a temporal extent is required for every query.
WithSpatialExtent(spatialExtent orb.Geometry)
Specify the geographical extent in which to query data. Optional, if not specified the query will return all results found globally.
WithSkipData()
default:"false"
Skip the data when querying datapoints. If set, only the required and auto-generated fields will be returned.

Returns

A sequence of bytes containing the requested data points as bytes.
import (
  "time"
  datasets "github.com/tilebox/tilebox-go/datasets/v1"
	"github.com/tilebox/tilebox-go/query"
)

startDate := time.Date(2014, 10, 4, 0, 0, 0, 0, time.UTC) 
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, []uuid.UUID{collection.ID}, datasets.WithTemporalExtent(queryInterval)),
)