hyperion.adapters.geocoder.static¶
hyperion.adapters.geocoder.static
¶
Static :class:~hyperion.ports.geocoder.Geocoder adapter (lite).
A dependency-free, offline geocoder backed by in-memory lookup tables. Intended
for tests and offline scenarios where the Google Maps API is unavailable. Its
error messages mirror :class:~hyperion.adapters.geocoder.google.GoogleMaps so
the two are substitutable behind the :class:~hyperion.ports.geocoder.Geocoder
port.
StaticGeocoder
¶
A geocoder that resolves from fixed lookup tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
locations
|
Mapping[str, Location] | None
|
Maps an address string to its :class: |
None
|
named_locations
|
Mapping[tuple[float, float], NamedLocation] | None
|
Maps a |
None
|
altitudes
|
Mapping[tuple[float, float], float] | None
|
Maps a |
None
|
Source code in hyperion/adapters/geocoder/static.py
geocode
¶
Resolve address from the static table.
reverse_geocode
¶
Resolve location coordinates from the static table.
language is accepted for :class:~hyperion.ports.geocoder.Geocoder
compatibility and ignored (static data is language-agnostic).
Source code in hyperion/adapters/geocoder/static.py
get_altitude
¶
Return the altitude of location from the static table.