Documentation
¶
Overview ¶
package coverage provides methods for deriving map tile coverage for Who's On First records.
Index ¶
- func CoverageWithFeature(ctx context.Context, opts *CoverageOptions, body []byte) (map[uint]maptile.Set, error)
- func CoverageWithFeatureAndCallback(ctx context.Context, opts *CoverageOptions, body []byte, ...) error
- func CoverageWithFeatureAndChannels(ctx context.Context, opts *CoverageOptions, body []byte, rsp_ch chan *Coverage, ...)
- type Coverage
- type CoverageCallbackFunc
- type CoverageOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoverageWithFeature ¶
func CoverageWithFeature(ctx context.Context, opts *CoverageOptions, body []byte) (map[uint]maptile.Set, error)
CoverageWithFeature returns a map of tiles for a Who's On Feature record. The map is keyed by zoom level and the value of each is a list of tiles that cover the feature.
func CoverageWithFeatureAndCallback ¶
func CoverageWithFeatureAndCallback(ctx context.Context, opts *CoverageOptions, body []byte, cb CoverageCallbackFunc) error
CoverageWithFeatureAndCallback will dispatch coverage information for each zoom level defined in 'opts' to a callback function defined in 'cb'.
func CoverageWithFeatureAndChannels ¶
func CoverageWithFeatureAndChannels(ctx context.Context, opts *CoverageOptions, body []byte, rsp_ch chan *Coverage, err_ch chan error, done_ch chan bool)
CoverageWithFeatureAndChannels returns coverage information for each zoom level defined in 'opts' as it is determined using channels.
Types ¶
type Coverage ¶
type Coverage struct { // The Who's On First ID of the record being processed. Id int64 // The zoom level being processed. Zoom uint // The set of tiles that cover feature 'Id' at zoom level 'Zoom'. Tiles maptile.Set }
Coverage is a struct containing information returned by the CoverageWithFeatureAndChannels.
type CoverageCallbackFunc ¶
CoverageCallbackFunc is a user-defined callback function invoked by CoverageWithFeatureAndCallback method.
type CoverageOptions ¶
type CoverageOptions struct { // A valid go-spatial/geom/slippy.Grid used to generate coverage information. Grid slippy.Grid // A list of zoom levels to determine coverage for. ZoomLevels []uint }
CoverageOptions defines common options for the CoverageWithFeature and CoverageWithFeatureAndChannels methods
func DefaultCoverageOptions ¶
func DefaultCoverageOptions() (*CoverageOptions, error)
DefaultCoverageOptions returns a CoverageOptions instance with a 4326 grid and zoom levels ranging from 1 to 20.