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 NewNullResults() spr.StandardPlacesResults
- func RegisterSpatialDatabase(ctx context.Context, scheme string, f SpatialDatabaseInitializeFunc) error
- func Schemes() []string
- type NullResults
- type NullSpatialDatabase
- func (db *NullSpatialDatabase) Close(ctx context.Context) error
- func (db *NullSpatialDatabase) Disconnect(context.Context) error
- func (db *NullSpatialDatabase) Exists(ctx context.Context, str_uri string) (bool, error)
- func (db *NullSpatialDatabase) Flush(ctx context.Context) error
- func (db *NullSpatialDatabase) IndexFeature(context.Context, []byte) error
- func (db *NullSpatialDatabase) Intersects(context.Context, orb.Geometry, ...spatial.Filter) (spr.StandardPlacesResults, error)
- func (db *NullSpatialDatabase) IntersectsWithIterator(context.Context, orb.Geometry, ...spatial.Filter) iter.Seq2[spr.StandardPlacesResult, error]
- func (db *NullSpatialDatabase) PointInPolygon(context.Context, *orb.Point, ...spatial.Filter) (spr.StandardPlacesResults, error)
- func (db *NullSpatialDatabase) PointInPolygonWithIterator(context.Context, *orb.Point, ...spatial.Filter) iter.Seq2[spr.StandardPlacesResult, error]
- func (db *NullSpatialDatabase) Read(ctx context.Context, str_uri string) (io.ReadSeekCloser, error)
- func (db *NullSpatialDatabase) ReaderURI(ctx context.Context, str_uri string) string
- func (db *NullSpatialDatabase) RemoveFeature(context.Context, string) error
- func (db *NullSpatialDatabase) SetLogger(ctx context.Context, logger *log.Logger) error
- func (db *NullSpatialDatabase) Write(ctx context.Context, key string, r io.ReadSeeker) (int64, error)
- func (db *NullSpatialDatabase) WriterURI(ctx context.Context, str_uri string) string
- type RTreeCache
- type RTreeResults
- type RTreeSpatialDatabase
- func (r *RTreeSpatialDatabase) Close(ctx context.Context) error
- func (r *RTreeSpatialDatabase) Disconnect(ctx context.Context) error
- func (r *RTreeSpatialDatabase) Exists(ctx context.Context, str_uri string) (bool, 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 NewNullResults ¶ added in v0.18.0
func NewNullResults() spr.StandardPlacesResults
func RegisterSpatialDatabase ¶
func RegisterSpatialDatabase(ctx context.Context, scheme string, f SpatialDatabaseInitializeFunc) error
Types ¶
type NullResults ¶ added in v0.18.0
type NullResults struct {
spr.StandardPlacesResults `json:",omitempty"`
}
func (*NullResults) Results ¶ added in v0.18.0
func (r *NullResults) Results() []spr.StandardPlacesResult
type NullSpatialDatabase ¶ added in v0.18.0
type NullSpatialDatabase struct {
SpatialDatabase
}
func (*NullSpatialDatabase) Close ¶ added in v0.18.0
func (db *NullSpatialDatabase) Close(ctx context.Context) error
func (*NullSpatialDatabase) Disconnect ¶ added in v0.18.0
func (db *NullSpatialDatabase) Disconnect(context.Context) error
Disconnect closes any underlying connections used by the index.
func (*NullSpatialDatabase) Flush ¶ added in v0.18.0
func (db *NullSpatialDatabase) Flush(ctx context.Context) error
func (*NullSpatialDatabase) IndexFeature ¶ added in v0.18.0
func (db *NullSpatialDatabase) IndexFeature(context.Context, []byte) error
func (*NullSpatialDatabase) Intersects ¶ added in v0.18.0
func (db *NullSpatialDatabase) Intersects(context.Context, orb.Geometry, ...spatial.Filter) (spr.StandardPlacesResults, error)
Intersects performs a intersects operation (as in intersecting geometries) to retrieve matching records from the index.
func (*NullSpatialDatabase) IntersectsWithIterator ¶ added in v0.18.0
func (db *NullSpatialDatabase) IntersectsWithIterator(context.Context, orb.Geometry, ...spatial.Filter) iter.Seq2[spr.StandardPlacesResult, error]
IntersectsWithIterator performs a intersects operation (as in intersecting geometries) yielding matching records in an iterator.
func (*NullSpatialDatabase) PointInPolygon ¶ added in v0.18.0
func (db *NullSpatialDatabase) PointInPolygon(context.Context, *orb.Point, ...spatial.Filter) (spr.StandardPlacesResults, error)
PointInPolygon performs a point-in-polygon operation to retrieve matching records from the index.
func (*NullSpatialDatabase) PointInPolygonWithIterator ¶ added in v0.18.0
func (db *NullSpatialDatabase) PointInPolygonWithIterator(context.Context, *orb.Point, ...spatial.Filter) iter.Seq2[spr.StandardPlacesResult, error]
PointInPolygon performs a point-in-polygon operation yielding matching records in an iterator.
func (*NullSpatialDatabase) Read ¶ added in v0.18.0
func (db *NullSpatialDatabase) Read(ctx context.Context, str_uri string) (io.ReadSeekCloser, error)
func (*NullSpatialDatabase) ReaderURI ¶ added in v0.18.0
func (db *NullSpatialDatabase) ReaderURI(ctx context.Context, str_uri string) string
func (*NullSpatialDatabase) RemoveFeature ¶ added in v0.18.0
func (db *NullSpatialDatabase) RemoveFeature(context.Context, string) error
RemoveFeature removes a Who's On First GeoJSON feature from the index.
func (*NullSpatialDatabase) Write ¶ added in v0.18.0
func (db *NullSpatialDatabase) Write(ctx context.Context, key string, r io.ReadSeeker) (int64, error)
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) Close ¶ added in v0.18.0
func (r *RTreeSpatialDatabase) Close(ctx context.Context) error
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 NewNullSpatialDatabase ¶ added in v0.18.0
func NewNullSpatialDatabase(ctx context.Context, uri string) (SpatialDatabase, error)
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)