Go SDK quickstart
Install the zero-dependency topolab-go module, create a context-aware client, and read a dataset as a typed GeoJSON FeatureCollection.
Requires: Go 1.23+ and an API key. Reading features over OGC is a Team / Enterprise plan capability. The SDK is in preview; the REST and OGC APIs it wraps are generally available.
Install and create a client
The topolab-go module is idiomatic and zero-dependency, using only the Go standard library. Install it and construct a client, reading the key from the environment. Datasets are addressed by their table name.
go get github.com/topolab-bv/topolab-go
import "github.com/topolab-bv/topolab-go/topolab"
tl := topolab.New(topolab.WithAPIKey(os.Getenv("TOPOLAB_API_KEY")))
Read a dataset as GeoJSON
tl.Dataset() references a dataset by table; ToGeoJSON materializes its features as a typed FeatureCollection with geometry in WGS84 (EPSG:4326). Every call takes a context.Context. This reads features from the OGC API, which is a Team / Enterprise plan capability.
ctx := context.Background()
fc, err := tl.Dataset("nl-domino-poi").ToGeoJSON(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%d features\n", len(fc.Features))
Spatial queries and errorsIterItems returns a Go 1.23 iter.Seq2 you can range over directly to stream a bounding-box query page by page (BBox is [minLon, minLat, maxLon, maxLat]); ItemsAll fetches every matching feature concurrently. Failed requests return a *topolab.Error you match with errors.Is against sentinels like ErrAuthentication (401) and ErrRateLimit (429); the client honours Retry-After.
Laatst bijgewerkt 25 juli 2026