Go package for Who's On First search interfaces.
This is work in progress. Documentation to follow.
type Filter interface {
HasPlacetypes(flags.PlacetypeFlag) bool
IsCurrent(flags.ExistentialFlag) bool
IsDeprecated(flags.ExistentialFlag) bool
IsCeased(flags.ExistentialFlag) bool
IsSuperseded(flags.ExistentialFlag) bool
IsSuperseding(flags.ExistentialFlag) bool
IsAlternateGeometry(flags.AlternateGeometryFlag) bool
HasAlternateGeometry(flags.AlternateGeometryFlag) bool
}
type FullTextDatabase interface {
IndexFeature(context.Context, geojson.Feature) error
QueryString(context.Context, string, ...filter.Filter) (spr.StandardPlacesResults, error)
Close(context.Context) error
}
type SpatialDatabase interface {
IndexFeature(context.Context, geojson.Feature) error
PointInPolygon(context.Context, *geom.Coord, ...filter.Filter) (spr.StandardPlacesResults, error)
PointInPolygonCandidates(context.Context, *geom.Coord, ...filter.Filter) ([]*spatial.PointInPolygonCandidate, error)
PointInPolygonWithChannels(context.Context, chan spr.StandardPlacesResult, chan error, chan bool, *geom.Coord, ...filter.Filter)
PointInPolygonCandidatesWithChannels(context.Context, chan *spatial.PointInPolygonCandidate, chan error, chan bool, *geom.Coord, ...filter.Filter)
Close(context.Context) error
}
As of this writing the spatial
interfaces are currently defined and implemented in the go-whosonfirst-spatial, and related, packages. Some or all of that work may be migrated in to this package but nothing final has been decided yet.