web / lib/services/geocoding/geocoding-operations
lib/services/geocoding/geocoding-operations
Implements the core operational logic for the geocoding service.
This class orchestrates the entire geocoding process. It integrates the provider manager and cache manager to perform geocoding lookups efficiently and resiliently.
Its responsibilities include:
- Checking the cache for an address before querying external providers.
- Sequentially trying configured geocoding providers based on their priority.
- Handling provider fallbacks in case of failures.
- Managing batch geocoding requests.
- Providing a method to test the configuration of all active providers.
Classes
GeocodingOperations
Constructors
Constructor
new GeocodingOperations(
providerManager,cacheManager,settings):GeocodingOperations
Parameters
providerManager
cacheManager
settings
null | GeocodingSettings
Returns
Methods
geocode()
geocode(
address):Promise<GeocodingResult>
Parameters
address
string
Returns
Promise<GeocodingResult>
batchGeocode()
batchGeocode(
addresses,batchSize):Promise<BatchGeocodingResult>
Parameters
addresses
string[]
batchSize
number = 10
Returns
Promise<BatchGeocodingResult>
testConfiguration()
testConfiguration(
testAddress):Promise<Record<string,unknown>>
Parameters
testAddress
string = "1600 Amphitheatre Parkway, Mountain View, CA"
Returns
Promise<Record<string, unknown>>