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 IndexDatabaseWithIterators(ctx context.Context, db SpatialDatabase, sources map[string][]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 (db *RTreeSpatialDatabase) Intersects(ctx context.Context, geom orb.Geometry, filters ...spatial.Filter) (spr.StandardPlacesResults, error)
- func (db *RTreeSpatialDatabase) IntersectsWithIterator(ctx context.Context, geom orb.Geometry, filters ...spatial.Filter) iter.Seq2[spr.StandardPlacesResult, error]
- func (db *RTreeSpatialDatabase) PointInPolygon(ctx context.Context, coord *orb.Point, filters ...spatial.Filter) (spr.StandardPlacesResults, error)
- func (db *RTreeSpatialDatabase) PointInPolygonWithIterator(ctx context.Context, coord *orb.Point, filters ...spatial.Filter) iter.Seq2[spr.StandardPlacesResult, 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/v3 iterator. Only records whose geometry type are 'Polygon' or 'MultiPolygon' will be indexed.
func IndexDatabaseWithIterators ¶ added in v0.13.1
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) Intersects ¶ added in v0.13.0
func (*RTreeSpatialDatabase) IntersectsWithIterator ¶ added in v0.13.0
func (*RTreeSpatialDatabase) PointInPolygon ¶ added in v0.9.0
func (*RTreeSpatialDatabase) PointInPolygonWithIterator ¶ added in v0.13.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)