Source: factory.core/ObjGeoLocation.py
Geocoding, reverse geocoding and IP-based location lookup.
All Nominatim requests are rate-limited to comply with the OpenStreetMap
usage policy (1 request/second). IP geolocation uses the free tier of
ip-api.com (no API key, max 45 req/min).
| Method | Signature | Description |
|---|---|---|
| geocode | geocode(address: str, use_ai: bool = True, countrycodes: str = '') -> Optional[GeoPointType] |
Resolve an address string to geographic coordinates. |
| reverse_geocode | reverse_geocode(lat: float, lng: float) -> Optional[GeoPointType] |
Convert lat/lng coordinates to a human-readable address. |
| geocode_ip | geocode_ip(ip_address: str) -> Optional[GeoPointType] |
Estimate geographic location from an IPv4 or IPv6 address. |
| geocode_batch | geocode_batch(addresses: list[str], use_ai: bool = True) -> list[Optional[GeoPointType]] |
Geocode a list of address strings. |
| reverse_geocode_batch | reverse_geocode_batch(coords: list[tuple[float, float]]) -> list[Optional[GeoPointType]] |
Reverse-geocode a list of (lat, lng) coordinate pairs. |
| geocode_ip_batch | geocode_ip_batch(ip_addresses: list[str]) -> list[Optional[GeoPointType]] |
Geolocate a list of IP addresses. |
| geocode_sql | geocode_sql(sql: str, columns: int | list[int] = 0, separator: str = ', ', use_ai: bool = True) -> list[Optional[GeoPointType]] |
Geocode addresses returned by a SQL query. |
| geocode_excoded_payload | geocode_excoded_payload(payload: 'str | dict', encoding: ExcodedEncoding, address_type: str = 'R', use_ai: bool = True) -> list[Optional[GeoPointType]] |
Geocode addresses embedded in an encoded payload blob. |
| geocode_sql_excoded | geocode_sql_excoded(sql: str, encoding: ExcodedEncoding, payload_column: int = 0, address_type: str = 'R', use_ai: bool = True) -> list[list[Optional[GeoPointType]]] |
Geocode encoded payload addresses returned by a SQL query. |
| scan_all_address_types | scan_all_address_types(source_table: str, encoding: ExcodedEncoding, address_types: Optional[list[str]] = None, **kwargs) -> dict[str, int] |
Run geomap_excoded for each address type and return inserted counts. |
| geomap_excoded | geomap_excoded(source_table: str, encoding: ExcodedEncoding, guid_column: str = 'Guid', id_column: str = 'idnumber', payload_column: str = 'EnvelopePayload', address_type: str = 'R', use_ai: bool = True, use_postcode: bool = False, min_confidence: float = 0.0, limit: int = 0) -> int |
Scan a table containing encoded payloads and write geocoded |