Genom
Fast reverse geocoding library with enriched location data. Convert coordinates to detailed place information including timezone, currency, region, and more.
Features
- Simple API - Single function call:
genom::lookup(lat, lon) - Rich Data - Returns 18+ fields including timezone, currency, postal code, region
- Fast Lookups - Grid-based spatial indexing for sub-millisecond queries
- Zero Config - Database builds automatically on first install
- Thread-Safe - Global singleton with lazy initialization
- Compact - Efficient binary format with string interning
Installation
[]
= "0.1"
Quick Start
use genom;
Returned Data
The Place struct contains:
Examples
Basic Lookup
use genom;
let place = lookup?;
println!;
println!;
println!;
println!;
Timezone Information
let place = lookup?;
println!;
println!;
println!;
Region Details
let place = lookup?;
println!;
println!;
println!;
println!;
EU Membership Check
let place = lookup?;
if place.is_eu
CLI Usage
# Install
# Lookup coordinates
Output:
New York
Region: New York
Region Code: NY
District: New York County
Country: United States (US)
Continent: North America (NA)
Postal Code: 10007
Timezone: America/New_York (EST) UTC-5
UTC Offset: -18000 seconds
DST Active: false
Currency: USD
EU Member: false
Coords: 40.71427, -74.00597
Data Source
Built from GeoNames data, covering:
- 100+ countries
- Major cities and populated places
- Administrative regions
- Postal codes
- Timezone information
Performance
- Lookup Time: < 1ms typical
- Database Size: ~50MB compressed
- Memory Usage: Loaded once, shared globally
- Thread Safety: Lock-free reads
How It Works
- Build Time: Downloads GeoNames data and builds optimized binary database
- Runtime: Lazy loads database on first
lookup()call - Spatial Index: Grid-based partitioning for O(1) coordinate lookups
- String Interning: Deduplicates common strings (country names, etc.)
License
Apache-2.0