geocoding

package
v0.0.0-rc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGeocodeProvidersUnavailable = errors.New("geocode providers unavailable")
)

Functions

This section is empty.

Types

type Address

type Address struct {
	FormattedAddress string
	Street           string
	HouseNumber      string
	Suburb           string
	Postcode         string
	State            string
	StateCode        string
	StateDistrict    string
	County           string
	Country          string
	CountryCode      string
	City             string
}

type GeocodeConfig

type GeocodeConfig struct {
	Lang  language.Tag
	Limit int
}

type Location

type Location struct {
	Lat float64
	Lng float64
}

type Provider

type Provider interface {
	Geocode(address string, config GeocodeConfig) ([]*Location, error)
	GeocodeWithContext(ctx context.Context, address string, config GeocodeConfig) ([]*Location, error)
	ReverseGeocode(loc Location, config ReverseGeocodeConfig) ([]*Address, error)
	ReverseGeocodeWithContext(ctx context.Context, loc Location, config ReverseGeocodeConfig) ([]*Address, error)
}

type ProviderError

type ProviderError struct {
	// contains filtered or unexported fields
}

func NewProviderError

func NewProviderError(msg string, status int) *ProviderError

func (*ProviderError) Error

func (e *ProviderError) Error() string

func (*ProviderError) Status

func (e *ProviderError) Status() int

type ReverseGeocodeConfig

type ReverseGeocodeConfig struct {
	Lang  language.Tag
	Limit int
	Zoom  int
}

Directories

Path Synopsis
osm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL