Documentation ¶
Index ¶
- func IndexDatabaseWithFS(ctx context.Context, db SpatialDatabase, index_fs fs.FS) error
- func IndexDatabaseWithIterator(ctx context.Context, db SpatialDatabase, iterator_uri string, ...) error
- func IndexDatabaseWithReader(ctx context.Context, db SpatialDatabase, r io.Reader) error
- func RegisterSpatialDatabase(ctx context.Context, scheme string, f SpatialDatabaseInitializeFunc) error
- func Schemes() []string
- type RTreeCache
- type RTreeResults
- type RTreeSpatialDatabase
- func (r *RTreeSpatialDatabase) Disconnect(ctx context.Context) error
- func (r *RTreeSpatialDatabase) Flush(ctx context.Context) error
- func (r *RTreeSpatialDatabase) IndexFeature(ctx context.Context, body []byte) error
- func (r *RTreeSpatialDatabase) PointInPolygon(ctx context.Context, coord *orb.Point, filters ...spatial.Filter) (spr.StandardPlacesResults, error)
- func (r *RTreeSpatialDatabase) PointInPolygonCandidates(ctx context.Context, coord *orb.Point, filters ...spatial.Filter) ([]*spatial.PointInPolygonCandidate, error)
- func (r *RTreeSpatialDatabase) PointInPolygonCandidatesWithChannels(ctx context.Context, rsp_ch chan *spatial.PointInPolygonCandidate, ...)
- func (r *RTreeSpatialDatabase) PointInPolygonWithChannels(ctx context.Context, rsp_ch chan spr.StandardPlacesResult, err_ch chan error, ...)
- func (r *RTreeSpatialDatabase) Read(ctx context.Context, str_uri string) (io.ReadSeekCloser, error)
- func (r *RTreeSpatialDatabase) ReaderURI(ctx context.Context, str_uri string) string
- func (r *RTreeSpatialDatabase) RemoveFeature(ctx context.Context, id string) error
- func (r *RTreeSpatialDatabase) SetLogger(ctx context.Context, logger *log.Logger) error
- func (r *RTreeSpatialDatabase) Write(ctx context.Context, key string, fh io.ReadSeeker) (int64, error)
- func (r *RTreeSpatialDatabase) WriterURI(ctx context.Context, str_uri string) string
- type RTreeSpatialIndex
- type SpatialDatabase
- type SpatialDatabaseInitializeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexDatabaseWithFS ¶ added in v0.6.0
IndexDatabaseWithFS will walk the files contained in 'index_fs' indexing each in 'db'
func IndexDatabaseWithIterator ¶ added in v0.1.1
func IndexDatabaseWithIterator(ctx context.Context, db SpatialDatabase, iterator_uri string, iterator_sources ...string) error
IndexDatabaseWithIterator is a general-purpose method for indexing a `database.Spatial.Database` instance with a whosonfirst/go-whosonfirst-iterate/v2 iterator. Only records whose geometry type are 'Polygon' or 'MultiPolygon' will be indexed.
func IndexDatabaseWithReader ¶ added in v0.7.2
IndexDatabaseWithReader will index the data contained in 'r' in 'db'.
func RegisterSpatialDatabase ¶
func RegisterSpatialDatabase(ctx context.Context, scheme string, f SpatialDatabaseInitializeFunc) error
Types ¶
type RTreeCache ¶ added in v0.9.0
type RTreeResults ¶ added in v0.9.0
type RTreeResults struct { spr.StandardPlacesResults `json:",omitempty"` Places []spr.StandardPlacesResult `json:"places"` }
func (*RTreeResults) Results ¶ added in v0.9.0
func (r *RTreeResults) Results() []spr.StandardPlacesResult
type RTreeSpatialDatabase ¶ added in v0.9.0
type RTreeSpatialDatabase struct { SpatialDatabase // contains filtered or unexported fields }
func (*RTreeSpatialDatabase) Disconnect ¶ added in v0.9.0
func (r *RTreeSpatialDatabase) Disconnect(ctx context.Context) error
func (*RTreeSpatialDatabase) Flush ¶ added in v0.9.0
func (r *RTreeSpatialDatabase) Flush(ctx context.Context) error
func (*RTreeSpatialDatabase) IndexFeature ¶ added in v0.9.0
func (r *RTreeSpatialDatabase) IndexFeature(ctx context.Context, body []byte) error
func (*RTreeSpatialDatabase) PointInPolygon ¶ added in v0.9.0
func (*RTreeSpatialDatabase) PointInPolygonCandidates ¶ added in v0.9.0
func (*RTreeSpatialDatabase) PointInPolygonCandidatesWithChannels ¶ added in v0.9.0
func (*RTreeSpatialDatabase) PointInPolygonWithChannels ¶ added in v0.9.0
func (*RTreeSpatialDatabase) Read ¶ added in v0.9.0
func (r *RTreeSpatialDatabase) Read(ctx context.Context, str_uri string) (io.ReadSeekCloser, error)
func (*RTreeSpatialDatabase) ReaderURI ¶ added in v0.9.0
func (r *RTreeSpatialDatabase) ReaderURI(ctx context.Context, str_uri string) string
func (*RTreeSpatialDatabase) RemoveFeature ¶ added in v0.9.0
func (r *RTreeSpatialDatabase) RemoveFeature(ctx context.Context, id string) error
func (*RTreeSpatialDatabase) Write ¶ added in v0.9.0
func (r *RTreeSpatialDatabase) Write(ctx context.Context, key string, fh io.ReadSeeker) (int64, error)
type RTreeSpatialIndex ¶ added in v0.9.0
type RTreeSpatialIndex struct { Rect *rtreego.Rect Id string FeatureId string IsAlt bool AltLabel string }
func (*RTreeSpatialIndex) Bounds ¶ added in v0.9.0
func (i *RTreeSpatialIndex) Bounds() rtreego.Rect
type SpatialDatabase ¶
type SpatialDatabase interface { reader.Reader writer.Writer spatial.SpatialIndex }
SpatialDatabase is an interface for databases of Who's On First records. It defines no methods of its own but wrap three other interfaces: `whosonfirst/go-reader.Reader`, `whosonfirst/go-writer.Writer` and `whosonfirst/go-whosonfirst-spatial.SpatialIndex`.`
func NewRTreeSpatialDatabase ¶ added in v0.9.0
func NewRTreeSpatialDatabase(ctx context.Context, uri string) (SpatialDatabase, error)
func NewSpatialDatabase ¶
func NewSpatialDatabase(ctx context.Context, uri string) (SpatialDatabase, error)
type SpatialDatabaseInitializeFunc ¶
type SpatialDatabaseInitializeFunc func(ctx context.Context, uri string) (SpatialDatabase, error)