Versions in this module Expand all Collapse all v1 v1.0.0 Oct 3, 2026 Changes in this version + const Attribution + var ErrClosed = errors.New("geocode: database is closed") + var ErrInvalidCoordinate = errors.New("geocode: invalid latitude or longitude") + var ErrQueryTooBroad = errors.New("geocode: prefix matches more than 256 terms; enter more characters") + func Build(path string, features []Feature) (err error) + func BuildContext(ctx context.Context, path string, features []Feature) (err error) + func Normalize(s string) string + type Address struct + City string + Country string + CountryCode string + County string + HouseNumber string + Postcode string + State string + Street string + type DB struct + func Open(path string) (*DB, error) + func (db *DB) Close() error + func (db *DB) Handler() http.Handler + func (db *DB) Reverse(ctx context.Context, p Point, opts ReverseOptions) ([]Result, error) + func (db *DB) Search(ctx context.Context, q string, opts SearchOptions) ([]Result, error) + func (db *DB) Stats() Stats + func (db *DB) Verify() error + type Feature struct + Address Address + AdminLevel int + Aliases []string + Class string + Geometry [][]Point + Importance float64 + Name string + OSMID int64 + OSMType string + Point Point + Polygon bool + Type string + type ImportOptions struct + Country string + CountryCode string + Progress func(ImportProgress) + TempDir string + Workers int + type ImportProgress struct + Elapsed time.Duration + Features int + Objects uint64 + Stage string + type ImportStats struct + Duration time.Duration + Features int + IncompleteRelations uint64 + MissingNodeWays uint64 + Nodes uint64 + Relations uint64 + Ways uint64 + func ImportPBF(ctx context.Context, input, output string, opts ImportOptions) (stats ImportStats, err error) + type Point struct + Lat float64 + Lon float64 + type Result struct + Address Address + Class string + DisplayName string + Distance float64 + Importance float64 + Lat float64 + Lon float64 + Name string + OSMID int64 + OSMType string + Score float64 + Type string + type ReverseOptions struct + Class string + Limit int + RadiusMeters float64 + type SearchOptions struct + Bounds *[4]float64 + Limit int + Near *Point + Prefix bool + type Stats struct + Bytes int + Features uint32 + SpatialNodes int + Terms int