Mapradar
Mapradar is a location intelligence library that converts addresses to coordinates, finds nearby services (banks, hospitals), and calculates travel distances via Google Maps APIs.
Installation
Python
Rust
[]
= "0.5.0"
= { = "1", = ["full"] }
CLI Tool
# Python
# Rust
Usage
CLI Commands
# Geocode an address
# Find nearby amenities (JSON output)
# Export nearby amenities to GeoJSON or CSV
# Distance calculation
# Geofence (Point in radius)
# Location Scoring
Python Example
=
# Calculate travel distance between two points
=
= await
# Find banks and hospitals near an address
=
= await
# Export to GeoJSON
=
# Location Scoring
= await
Rust Example
use MapradarClient;
use ;
async
Features
| Feature | Description |
|---|---|
| Geocoding | Convert addresses to coordinates |
| Reverse Geocoding | Convert coordinates to addresses |
| Nearby Search | Find banks, hospitals, schools, etc. |
| Distance Fetching | Fast travel/Haversine distance with address fallthrough |
| Parallel Fetching | Search multiple service types at once |
| Caching | Automatic in-memory cache reduces API calls |
| JSON-RPC 2.0 | Built-in format for microservice APIs |
Configuration
| Option | Default | Description |
|---|---|---|
GOOGLE_MAPS_API_KEY |
None | Your Google Maps API key. Enable Geocoding API, Places API (New), and Routes API. |
max_results |
20 | Maximum number of places returned per category. |
radius |
5.0 | Search radius in kilometers. |
--mode |
drive |
Transit mode for distance calculation (e.g. drive, okada, auto, ojek, danfo, angkot). |
FAQ
Enable these in Google Cloud Console:
- Geocoding API
- Places API (New)
- Routes API (V2)
Mapradar does not rate limit locally. Your Google Maps API quota applies. Use the built-in Moka cache to reduce outbound calls.
No. Cache is in-memory only. It persists for the lifetime of your MapradarClient instance to ensure maximum security.