Documentation ¶
Overview ¶
Package pmtiles implements the `whosonfirst/go-whosonfirst-spatial` interfaces using a Protomaps `.pmtiles` database.
Index ¶
- Constants
- func FeatureId(feature *geojson.Feature) (string, error)
- func FeatureIdFromBytes(body []byte) (string, error)
- func NewPMTilesSpatialDatabase(ctx context.Context, uri string) (database.SpatialDatabase, error)
- func NewPMTilesSpatialDatabaseReader(ctx context.Context, uri string) (reader.Reader, error)
- func UniqueFeatures(ctx context.Context, features []*geojson.Feature) ([][]byte, error)
- type CacheManager
- func (m *CacheManager) CacheFeature(ctx context.Context, body []byte) (*FeatureCache, error)
- func (m *CacheManager) CacheFeatureCollection(ctx context.Context, fc *geojson.FeatureCollection) ([]string, error)
- func (m *CacheManager) CacheFeatures(ctx context.Context, features [][]byte) ([]string, error)
- func (m *CacheManager) Close(ctx context.Context) error
- func (m *CacheManager) GetFeatureCache(ctx context.Context, id string) (*FeatureCache, error)
- func (m *CacheManager) UnmarshalFeatureCache(ctx context.Context, fc *FeatureCache) (*geojson.Feature, error)
- type CacheManagerOptions
- type FeatureCache
- type PMTilesSpatialDatabase
- func (db *PMTilesSpatialDatabase) Disconnect(ctx context.Context) error
- func (db *PMTilesSpatialDatabase) IndexFeature(context.Context, []byte) error
- func (db *PMTilesSpatialDatabase) PointInPolygon(ctx context.Context, coord *orb.Point, filters ...spatial.Filter) (spr.StandardPlacesResults, error)
- func (db *PMTilesSpatialDatabase) PointInPolygonCandidates(ctx context.Context, coord *orb.Point, filters ...spatial.Filter) ([]*spatial.PointInPolygonCandidate, error)
- func (db *PMTilesSpatialDatabase) PointInPolygonCandidatesWithChannels(ctx context.Context, pip_ch chan *spatial.PointInPolygonCandidate, ...)
- func (db *PMTilesSpatialDatabase) PointInPolygonWithChannels(ctx context.Context, spr_ch chan spr.StandardPlacesResult, err_ch chan error, ...)
- func (db *PMTilesSpatialDatabase) Read(ctx context.Context, path string) (io.ReadSeekCloser, error)
- func (db *PMTilesSpatialDatabase) ReaderURI(ctx context.Context, path string) string
- func (db *PMTilesSpatialDatabase) RemoveFeature(context.Context, string) error
Constants ¶
View Source
const FEATURES_CACHE_TABLE string = "pmtiles_features"
Variables ¶
This section is empty.
Functions ¶
func FeatureIdFromBytes ¶ added in v0.0.7
func NewPMTilesSpatialDatabaseReader ¶ added in v0.0.3
Types ¶
type CacheManager ¶ added in v0.0.3
type CacheManager struct {
// contains filtered or unexported fields
}
func NewCacheManager ¶ added in v0.0.3
func NewCacheManager(ctx context.Context, opts *CacheManagerOptions) *CacheManager
func (*CacheManager) CacheFeature ¶ added in v0.0.3
func (m *CacheManager) CacheFeature(ctx context.Context, body []byte) (*FeatureCache, error)
func (*CacheManager) CacheFeatureCollection ¶ added in v0.0.7
func (m *CacheManager) CacheFeatureCollection(ctx context.Context, fc *geojson.FeatureCollection) ([]string, error)
func (*CacheManager) CacheFeatures ¶ added in v0.0.3
func (*CacheManager) Close ¶ added in v0.0.3
func (m *CacheManager) Close(ctx context.Context) error
func (*CacheManager) GetFeatureCache ¶ added in v0.0.3
func (m *CacheManager) GetFeatureCache(ctx context.Context, id string) (*FeatureCache, error)
func (*CacheManager) UnmarshalFeatureCache ¶ added in v0.0.3
func (m *CacheManager) UnmarshalFeatureCache(ctx context.Context, fc *FeatureCache) (*geojson.Feature, error)
type CacheManagerOptions ¶ added in v0.0.3
type CacheManagerOptions struct { FeatureCollection *docstore.Collection Logger *log.Logger CacheTTL int }
type FeatureCache ¶ added in v0.0.3
type FeatureCache struct { Created int64 `json:"created"` Id string `json:"id"` // this is a string rather than int64 because it might include an alt label Body string `json:"body"` }
func NewFeatureCache ¶ added in v0.0.3
func NewFeatureCache(body []byte) (*FeatureCache, error)
type PMTilesSpatialDatabase ¶
type PMTilesSpatialDatabase struct { database.SpatialDatabase // contains filtered or unexported fields }
func (*PMTilesSpatialDatabase) Disconnect ¶
func (db *PMTilesSpatialDatabase) Disconnect(ctx context.Context) error
func (*PMTilesSpatialDatabase) IndexFeature ¶
func (db *PMTilesSpatialDatabase) IndexFeature(context.Context, []byte) error
func (*PMTilesSpatialDatabase) PointInPolygon ¶
func (*PMTilesSpatialDatabase) PointInPolygonCandidates ¶
func (*PMTilesSpatialDatabase) PointInPolygonCandidatesWithChannels ¶
func (*PMTilesSpatialDatabase) PointInPolygonWithChannels ¶
func (*PMTilesSpatialDatabase) Read ¶ added in v0.0.3
func (db *PMTilesSpatialDatabase) Read(ctx context.Context, path string) (io.ReadSeekCloser, error)
Read implements the whosonfirst/go-reader.Reader interface
func (*PMTilesSpatialDatabase) ReaderURI ¶ added in v0.0.3
func (db *PMTilesSpatialDatabase) ReaderURI(ctx context.Context, path string) string
func (*PMTilesSpatialDatabase) RemoveFeature ¶
func (db *PMTilesSpatialDatabase) RemoveFeature(context.Context, string) error
Click to show internal directories.
Click to hide internal directories.