OOOC Fête Finder geocodes event addresses to display them on interactive maps. The integration uses Google Maps Geocoding API with Paris-specific confidence scoring, bounds validation, and arrondissement-based fallbacks.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KingPsychopath/oooc-fete-finder/llms.txt
Use this file to discover all available pages before exploring further.
Configuration
Environment variables
The Geocoding API requires an API key (not OAuth). If unset, the system falls back to arrondissement center coordinates.
Get an API key
Enable Geocoding API
- Go to Google Cloud Console
- Create or select a project
- Navigate to APIs & Services > Library
- Search for “Geocoding API”
- Click Enable
Create API key
- Go to APIs & Services > Credentials
- Click Create Credentials > API key
- Copy the generated key
Restrict API key (recommended)
- Click Edit API key
- Under API restrictions, select Restrict key
- Choose Geocoding API
- Optionally add application restrictions
Implementation details
Paris-specific geocoding
The integration includes Paris-specific enhancements (features/maps/coordinate-service.ts:53-69):Query construction
The system builds queries with arrondissement context (features/maps/coordinate-service.ts:74-87):Adding arrondissement context improves geocoding accuracy by narrowing the search area within Paris.
Confidence scoring
Confidence scores combine Google’s accuracy with Paris-specific validation (features/maps/coordinate-service.ts:92-115):- Base confidence: From Google’s location type (ROOFTOP, RANGE_INTERPOLATED, etc.)
- +0.1 bonus: Coordinates within Paris bounds
- +0.1 bonus: Formatted address matches requested arrondissement
Bounds validation
All geocoded coordinates are validated against Paris bounds (features/maps/coordinate-service.ts:120-130). If coordinates fall outside, a warning is logged but the result is still returned.Geocoding flow
TheCoordinateService.getCoordinates method (features/maps/coordinate-service.ts:296-464) follows this flow:
Validate input
Check that location name and arrondissement are valid:
- Location name not empty, “TBA”, or “TBC”
- Arrondissement is a number between 1-20
Check storage
Look up the location in cached storage by key
{location}_{arrondissement}.If found and not marked as “estimated”, return cached coordinates.Geocode with API
If not in storage or forcing refresh:
- Build Paris search query
- Call Google Geocoding API
- Validate coordinates within Paris bounds
- Calculate confidence score
- Store result for future lookups
Fatal error handling
If a fatal API error occurs (lib/google/geocoding/api.ts:60-68), the system:- Logs a single warning about the issue
- Switches to arrondissement fallback for all remaining locations
- Avoids repeated API calls and error logs
- Missing or invalid API key
- API not enabled in Google Cloud Console
- Billing issues or trial ended
- Request denied errors
API endpoints
The integration uses Google Maps Geocoding API v3:- Forward geocoding:
GET https://maps.googleapis.com/maps/api/geocode/json?address={query}&key={apiKey} - Reverse geocoding:
GET https://maps.googleapis.com/maps/api/geocode/json?latlng={lat},{lng}&key={apiKey}
Timeouts
- Request timeout: 10 seconds
- Batch delay: 100ms between batches (rate limiting)
- Batch size: 10 addresses per batch
Batch geocoding
For bulk operations, usegeocodeAddressesBatch (lib/google/geocoding/api.ts:135-224):
Batch geocoding processes addresses in parallel batches of 10 with exponential backoff retry for transient failures.
Storage and caching
Geocoded locations are stored in the database with metadata:Source types
- geocoded: Successfully geocoded via Google Maps API
- estimated: Fallback to arrondissement center coordinates
- manual: Manually set coordinates (highest confidence)
Upgrade from estimated to geocoded
When the API becomes available, estimated locations are automatically upgraded to geocoded on next lookup (features/maps/coordinate-service.ts:318-356).Usage in event processing
The admin panel populates coordinates when importing events:- Parse location name and arrondissement from event data
- Check if coordinates are already stored
- If not, geocode the location
- Store result for future events at the same location
- Attach coordinates to event record
Error handling
The integration categorizes errors by type (features/maps/coordinate-service.ts:16-25):API_ERROR- General API failureNO_RESULTS- Address not foundRATE_LIMIT- Quota exceededNETWORK_ERROR- Timeout or connection failurePARSE_ERROR- Invalid response formatCONFIG_ERROR- Missing or invalid API key
API reference
The unified API is exported from lib/google/geocoding/api.ts:299-303:Methods
geocodeAddress(address)- Geocode a single addressgeocodeAddressesBatch(addresses, options)- Batch geocode multiple addressesreverseGeocode(latitude, longitude)- Convert coordinates to address
Performance considerations
- Storage first: Always check cached storage before calling API
- Batch processing: Process multiple locations in parallel batches
- Rate limiting: 100ms delay between batches
- Retry logic: Exponential backoff for transient failures
- Fatal error detection: Stop API calls after fatal configuration errors
Cost optimization
To minimize Google Maps API costs:- Storage caches all geocoded locations
- Estimated locations are reused until API is configured
- Fatal errors prevent unnecessary API calls
- Batch processing reduces request overhead
Google Maps Geocoding API pricing: $5 per 1,000 requests. The first 40,000 requests per month are free.