datasources

package
v1.8.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datasource

type Datasource interface {

	// GetFeatureIDs returns all IDs of Features matching the given criteria, as well as Cursors for pagination.
	// To be used in concert with GetFeaturesByID
	GetFeatureIDs(ctx context.Context, collection string, criteria FeaturesCriteria) ([]int64, domain.Cursors, error)

	// GetFeaturesByID returns a collection of Features with the given IDs. To be used in concert with GetFeatureIDs
	GetFeaturesByID(ctx context.Context, collection string, featureIDs []int64, axisOrder domain.AxisOrder, profile domain.Profile) (*domain.FeatureCollection, error)

	// GetFeatures returns all Features matching the given criteria and Cursors for pagination
	GetFeatures(ctx context.Context, collection string, criteria FeaturesCriteria, axisOrder domain.AxisOrder, profile domain.Profile) (*domain.FeatureCollection, domain.Cursors, error)

	// GetFeature returns a specific Feature, based on its feature id
	GetFeature(ctx context.Context, collection string, featureID any, outputSRID domain.SRID, axisOrder domain.AxisOrder, profile domain.Profile) (*domain.Feature, error)

	// SearchFeaturesAcrossCollections search features in one or more collections. Collections can be located
	// in this dataset or in other datasets.
	SearchFeaturesAcrossCollections(ctx context.Context, criteria FeaturesSearchCriteria, axisOrder domain.AxisOrder, collections searchdomain.CollectionsWithParams) (*domain.FeatureCollection, error)

	// GetSchema returns the schema (fields, data types, descriptions, etc.) of the table associated with the given collection
	GetSchema(collection string) (*domain.Schema, error)

	// GetPropertyFiltersWithAllowedValues returns configured property filters for the given collection enriched with allowed values.
	// When enrichments don't apply, the returned result should still contain all property filters as specified in the (YAML) config.
	GetPropertyFiltersWithAllowedValues(collection string) PropertyFiltersWithAllowedValues

	// GetCollectionType returns the type of data in the given collection, e.g. 'features' or 'attributes'.
	GetCollectionType(collection string) (geospatial.CollectionType, string, error)

	// SupportsOnTheFlyTransformation returns whether the datasource supports coordinate transformation/reprojection on-the-fly
	SupportsOnTheFlyTransformation() bool

	// Close closes (connections to) the datasource gracefully
	Close()
}

Datasource holds all Features for a single object type in a specific projection/CRS. This abstraction allows the rest of the system to stay datastore agnostic.

type FeaturesCriteria

type FeaturesCriteria struct {
	// pagination (OAF part 1)
	Cursor domain.DecodedCursor
	Limit  int

	// multiple projections support (OAF part 2)
	InputSRID  domain.SRID // derived from bbox or filter param when available, or WGS84 as default
	OutputSRID domain.SRID // derived from crs param when available, or WGS84 as default

	// filtering by bounding box (OAF part 1)
	Bbox *geom.Bounds

	// filtering by reference date/time (OAF part 1)
	TemporalCriteria TemporalCriteria

	// filtering by properties (OAF part 1)
	PropertyFilters map[string]string

	// filtering by CQL (OAF part 3)
	Filter Part3Filter
}

FeaturesCriteria to select a certain set of Features.

type FeaturesSearchCriteria added in v1.5.0

type FeaturesSearchCriteria struct {
	// the search query after query expansion
	SearchQuery searchdomain.SearchQuery

	// global search settings
	Settings config.SearchSettings

	// search doesn't use pagination, we just return the top N results as indicated by the specified limit
	Limit int

	// multiple projections support (OAF part 2)
	InputSRID  domain.SRID // derived from bbox param when available, or WGS84 as default
	OutputSRID domain.SRID // derived from crs param when available, or WGS84 as default

	// filtering by bounding box (OAF part 1)
	Bbox *geom.Bounds
}

FeaturesSearchCriteria to search features (geocoding).

type Part3Filter added in v1.7.12

type Part3Filter struct {
	SQL    string
	Params map[string]any
}

Part3Filter OAF part 3 filter based on CQL

type PropertyFilterWithAllowedValues added in v0.51.0

type PropertyFilterWithAllowedValues struct {
	config.PropertyFilter

	// static or dynamic values that are allowed to be used in this property filter
	AllowedValues []string
}

PropertyFilterWithAllowedValues property filter as configured in the (YAML) config, but enriched with allowed values.

type PropertyFiltersWithAllowedValues added in v0.51.0

type PropertyFiltersWithAllowedValues map[string]PropertyFilterWithAllowedValues

PropertyFiltersWithAllowedValues one or more PropertyFilterWithAllowedValues indexed by property filter name.

type TemporalCriteria

type TemporalCriteria struct {
	// reference date
	ReferenceDate time.Time

	// startDate and endDate properties
	StartDateProperty string
	EndDateProperty   string
}

TemporalCriteria criteria to filter based on date/time.

Directories

Path Synopsis
encoding
Package encoding based on https://github.com/go-spatial/geom/blob/master/encoding/gpkg/binary_header.go
Package encoding based on https://github.com/go-spatial/geom/blob/master/encoding/gpkg/binary_header.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL