provider

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCanceled    = errors.New("provider: canceled")
	ErrUnsupported = errors.New("provider: unsupported")
)

Functions

func Cleanup

func Cleanup()

func ConvertFeatureID

func ConvertFeatureID(v interface{}) (uint64, error)

ConvertFeatureID attempts to convert an interface value to an uint64

func Drivers

func Drivers() (l []string)

Drivers returns a list of registered drivers.

func Register

func Register(name string, init InitFunc, cleanup CleanupFunc) error

Register the provider with the system. This call is generally made in the init functions of the provider.

the clean up function will be called during shutdown of the provider to allow the provider to do any cleanup.

Types

type CleanupFunc

type CleanupFunc func()

CleanupFunc is called to when the system is shuting down, this allows the provider to cleanup.

type ErrUnableToConvertFeatureID

type ErrUnableToConvertFeatureID struct {
	// contains filtered or unexported fields
}

func (ErrUnableToConvertFeatureID) Error

type Feature

type Feature struct {
	ID       uint64
	Geometry geom.Geometry
	SRID     uint64
	Tags     map[string]interface{}
}

type InitFunc

type InitFunc func(dicter dict.Dicter) (Tiler, error)

InitFunc initilize a provider given a config map. The init function should validate the config map, and report any errors. This is called by the For function.

type LayerInfo

type LayerInfo interface {
	Name() string
	GeomType() geom.Geometry
	SRID() uint64
}

type Tile

type Tile interface {
	// ZXY returns the z, x and y values of the tile
	ZXY() (uint, uint, uint)
	// Extent returns the extent of the tile excluding any buffer
	Extent() (extent *geom.Extent, srid uint64)
	// BufferedExtent returns the extent of the tile including any buffer
	BufferedExtent() (extent *geom.Extent, srid uint64)
}

type Tiler

type Tiler interface {
	// TileFeature will stream decoded features to the callback function fn
	// if fn returns ErrCanceled, the TileFeatures method should stop processing
	TileFeatures(ctx context.Context, layer string, t Tile, fn func(f *Feature) error) error
	// Layers returns information about the various layers the provider supports
	Layers() ([]LayerInfo, error)
}

func For

func For(name string, config dict.Dicter) (Tiler, error)

For function returns a configured provider of the given type, provided the correct config map.

Directories

Path Synopsis
The debug provider returns features that are helpful for debugging a tile including a box for the tile edges and a point in the middle of the tile with z,x,y values encoded
The debug provider returns features that are helpful for debugging a tile including a box for the tile edges and a point in the middle of the tile with z,x,y values encoded

Jump to

Keyboard shortcuts

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