Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Contains = containsFunc(func(geofence *geom.Polygon, hash string) (bool, error) {
hashGeo := hashToGeometry(hash)
fence := polygonToGeometry(geofence)
return fence.Contains(hashGeo)
})
Contains tests if the geofence contains the hash by doing a geos contains.
var Intersects = intersectsFunc(func(geofence *geom.Polygon, hash string) (bool, error) {
hashGeo := hashToGeometry(hash)
fence := polygonToGeometry(geofence)
return fence.Intersects(hashGeo)
})
Intersects tests if the geofence contains the hash by doing a geos intersection.
Functions ¶
This section is empty.
Types ¶
type Intersector ¶
Intersector tests if a hash intersects.
type Option ¶
type Option func(*RecursiveFiller)
Option allows options to be passed to RecursiveFiller
func WithFixedPrecision ¶
func WithFixedPrecision() Option
WithFixedPrecision makes the filler fill to a fixed precision rather than a variable one.
func WithMaxPrecision ¶
WithMaxPrecision sets the highest precision we'll fill to. Defaults to 6.
func WithPredicates ¶
func WithPredicates(contains Container, intersects Intersector) Option
WithPredicates overrides the default predicates used for geometric tests.
type RecursiveFiller ¶
type RecursiveFiller struct {
// contains filtered or unexported fields
}
RecursiveFiller fills the geofence by recursively searching for the largest geofence which is matched by the intersecting/contains predicate.
func NewRecursiveFiller ¶
func NewRecursiveFiller(options ...Option) *RecursiveFiller
NewRecursiveFiller creates a new filler with the given options.