geocoding

package
v0.0.0-...-46e3884 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGSIURL = "https://mreversegeocoder.gsi.go.jp/reverse-geocoder/LonLatToAddress"
View Source
const DefaultNominatimURL = "https://nominatim.openstreetmap.org/reverse"

Variables

View Source
var ErrGSIUnavailable = errors.New("GSI API is temporarily unavailable")

ErrGSIUnavailable indicates that the GSI API is temporarily unavailable (502/503/504)

Functions

func Echo

func Echo(g *echo.Group, conf *HandlerConfig) error

Types

type Area

type Area struct {
	Type   string  `json:"type"`
	Code   string  `json:"code"`
	Name   string  `json:"name"`
	Radius float64 `json:"radius"`
}

func BuildAreas

func BuildAreas(code string, includeRadii bool) ([]*Area, error)

type Areas

type Areas struct {
	Address string  `json:"address"`
	Areas   []*Area `json:"areas"`
}

type GSIClient

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

func NewGSIClient

func NewGSIClient(httpClient *http.Client, url string) *GSIClient

func (*GSIClient) Fetch

func (c *GSIClient) Fetch(ctx context.Context, lon, lat float64) (*GSIResult, error)

type GSIResult

type GSIResult struct {
	MunicipalityCode string
	Name             string
}

type HandlerConfig

type HandlerConfig struct {
	GSIURL       string
	NominatimURL string
}

type NominatimClient

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

func NewNominatimClient

func NewNominatimClient(httpClient *http.Client, url, userAgent string) *NominatimClient

func (*NominatimClient) Fetch

func (c *NominatimClient) Fetch(ctx context.Context, lon, lat float64) (*GSIResult, error)

Jump to

Keyboard shortcuts

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