geo

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package geo offers OpenStreetMap reverse geocoding and nearby place search.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNearbyPlacesOSMExecutor

func NewNearbyPlacesOSMExecutor(service *OSMService) tools.Executor

func NewOSMGeoExecutors

func NewOSMGeoExecutors(service *OSMService) []tools.Executor

func NewReverseGeocodeOSMExecutor

func NewReverseGeocodeOSMExecutor(service *OSMService) tools.Executor

Types

type OSMAddress

type OSMAddress struct {
	HouseNumber   string `json:"house_number,omitempty"`
	Road          string `json:"road,omitempty"`
	Neighbourhood string `json:"neighbourhood,omitempty"`
	Suburb        string `json:"suburb,omitempty"`
	District      string `json:"district,omitempty"`
	City          string `json:"city,omitempty"`
	County        string `json:"county,omitempty"`
	State         string `json:"state,omitempty"`
	Postcode      string `json:"postcode,omitempty"`
	Country       string `json:"country,omitempty"`
	CountryCode   string `json:"country_code,omitempty"`
}

type OSMConfig

type OSMConfig struct {
	NominatimBaseURL string
	OverpassEndpoint string
	UserAgent        string
	HTTPClient       *http.Client
	ReverseCacheTTL  time.Duration
	NearbyCacheTTL   time.Duration
	Disabled         bool
}

type OSMNearbyPlacesParams

type OSMNearbyPlacesParams struct {
	Latitude     float64  `json:"latitude"`
	Longitude    float64  `json:"longitude"`
	RadiusMeters int      `json:"radius_m,omitempty"`
	Limit        int      `json:"limit,omitempty"`
	Categories   []string `json:"categories,omitempty"`
}

type OSMNearbyPlacesResult

type OSMNearbyPlacesResult struct {
	Latitude     float64    `json:"latitude"`
	Longitude    float64    `json:"longitude"`
	RadiusMeters int        `json:"radius_m"`
	Categories   []string   `json:"categories"`
	Places       []OSMPlace `json:"places"`
	Source       string     `json:"source"`
	Attribution  string     `json:"attribution"`
}

type OSMPlace

type OSMPlace struct {
	Name           string            `json:"name"`
	Amenity        string            `json:"amenity,omitempty"`
	Cuisine        string            `json:"cuisine,omitempty"`
	DistanceMeters int               `json:"distance_m"`
	Latitude       float64           `json:"latitude"`
	Longitude      float64           `json:"longitude"`
	Address        string            `json:"address,omitempty"`
	AddressTags    map[string]string `json:"address_tags,omitempty"`
	OpeningHours   string            `json:"opening_hours,omitempty"`
	Phone          string            `json:"phone,omitempty"`
	Website        string            `json:"website,omitempty"`
	OSMType        string            `json:"osm_type"`
	OSMID          int64             `json:"osm_id"`
	OSMURL         string            `json:"osm_url,omitempty"`
}

type OSMReverseGeocodeParams

type OSMReverseGeocodeParams struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Language  string  `json:"language,omitempty"`
}

type OSMReverseGeocodeResult

type OSMReverseGeocodeResult struct {
	Latitude    float64           `json:"latitude"`
	Longitude   float64           `json:"longitude"`
	DisplayName string            `json:"display_name,omitempty"`
	Address     OSMAddress        `json:"address,omitempty"`
	AddressTags map[string]string `json:"address_tags,omitempty"`
	OSMType     string            `json:"osm_type,omitempty"`
	OSMID       int64             `json:"osm_id,omitempty"`
	Category    string            `json:"category,omitempty"`
	Type        string            `json:"type,omitempty"`
	Source      string            `json:"source"`
	Attribution string            `json:"attribution"`
}

type OSMService

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

func NewOSMService

func NewOSMService(cfg OSMConfig) *OSMService

func NewOSMServiceFromEnv

func NewOSMServiceFromEnv() *OSMService

func (*OSMService) NearbyPlaces

func (*OSMService) ReverseGeocode

Jump to

Keyboard shortcuts

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