Documentation
¶
Index ¶
- Constants
- Variables
- func Cleanup()
- func ConvertFeatureID(v interface{}) (uint64, error)
- func Drivers(types ...providerType) (l []string)
- func MVTRegister(name string, init MVTInitFunc, cleanup CleanupFunc) error
- func Register(name string, init InitFunc, cleanup CleanupFunc) error
- type CleanupFunc
- type ErrInvalidProviderType
- type ErrInvalidRegisteredProvider
- type ErrProviderAlreadyExists
- type ErrUnableToConvertFeatureID
- type ErrUnknownProvider
- type Feature
- type InitFunc
- type Layer
- type LayerInfo
- type Layerer
- type MVTInitFunc
- type MVTTiler
- type Tile
- type Tiler
- type TilerUnion
Constants ¶
const ( // TypeStd declares a provider to be a standard provider TypeStd providerType = 1 << iota // TypeMvt declares a provider to be an mvt provider. TypeMvt // TypeAll should be all the types TypeAll = TypeStd & TypeMvt )
Variables ¶
Functions ¶
func ConvertFeatureID ¶
ConvertFeatureID attempts to convert an interface value to an uint64
func Drivers ¶
func Drivers(types ...providerType) (l []string)
Drivers returns a list of registered drivers.
func MVTRegister ¶ added in v0.12.0
func MVTRegister(name string, init MVTInitFunc, cleanup CleanupFunc) error
MVTRegister 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.
The init function can not be nil, the cleanup function may be nil
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.
The init function can not be nil, the cleanup function may be nil
Types ¶
type CleanupFunc ¶
type CleanupFunc func()
CleanupFunc is called to when the system is shutting down, this allows the provider to cleanup.
type ErrInvalidProviderType ¶ added in v0.12.0
ErrInvalidProviderType is return when the requested provider type is not known for the given name
func (ErrInvalidProviderType) Error ¶ added in v0.12.0
func (err ErrInvalidProviderType) Error() string
type ErrInvalidRegisteredProvider ¶ added in v0.12.0
type ErrInvalidRegisteredProvider struct {
Name string
}
ErrInvalidRegisteredProvider is returned when something went wrong with the provider registration. This should never happen, in normal usage, and if it does it's an issue with the provider plugin.
func (ErrInvalidRegisteredProvider) Error ¶ added in v0.12.0
func (err ErrInvalidRegisteredProvider) Error() string
type ErrProviderAlreadyExists ¶ added in v0.11.0
type ErrProviderAlreadyExists struct {
Name string
}
ErrProviderAlreadyExists is returned when the Provider being registered already exists in the registration system
func (ErrProviderAlreadyExists) Error ¶ added in v0.11.0
func (err ErrProviderAlreadyExists) Error() string
type ErrUnableToConvertFeatureID ¶
type ErrUnableToConvertFeatureID struct {
// contains filtered or unexported fields
}
func (ErrUnableToConvertFeatureID) Error ¶
func (e ErrUnableToConvertFeatureID) Error() string
type ErrUnknownProvider ¶ added in v0.11.0
ErrUnknownProvider is returned when no providers are registered or requested provider is not registered
func (ErrUnknownProvider) Error ¶ added in v0.11.0
func (err ErrUnknownProvider) Error() string
type InitFunc ¶
InitFunc initialize 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 Layer ¶ added in v0.12.0
type Layer struct { // Name is the name of the Layer as recognized by the provider Name string // MVTName is the name of the layer to encode into the MVT. // this is often used when different provider layers are used // at different zoom levels but the MVT layer name is consistent MVTName string }
Layer holds information about a query.
type LayerInfo ¶
type LayerInfo interface { // Name is the name of the layer Name() string // GeomType is the geometry type of the layer GeomType() geom.Geometry // SRID is the srid of all the points in the layer SRID() uint64 }
LayerInfo is the important information about a layer
type Layerer ¶ added in v0.11.0
type Layerer interface { // Layers returns information about the various layers the provider supports Layers() ([]LayerInfo, error) }
Layerer are objects that know about their layers
type MVTInitFunc ¶ added in v0.12.0
MVTInitFunc initialize 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 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) }
Tile is an interface used by Tiler, it is an unnecessary abstraction and is due to be removed. The tiler interface will, instead take a, *geom.Extent.
type Tiler ¶
type Tiler interface { Layerer // 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 }
Tiler is a Layers that allows one to encode features in that layer
type TilerUnion ¶ added in v0.12.0
TilerUnion represents either a Std Tiler or and MVTTiler; only one should be not nil.
func For ¶
func For(name string, config dict.Dicter) (val TilerUnion, err error)
For function returns a configure provider of the given type; The provider may be a mvt provider or a std provider. The correct entry in TilerUnion will not be nil. If there is an error both entries will be nil.
func (TilerUnion) Layers ¶ added in v0.12.0
func (tu TilerUnion) Layers() ([]LayerInfo, error)
Layers return the layers of the Tiler. It will only return Std layers if STD is defined other the MVT layers
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 |