Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Nominatim Provider

Nominatim Provider Laravel Package

geocoder-php/nominatim-provider

Nominatim provider for Geocoder PHP. Adds OpenStreetMap Nominatim geocoding and reverse geocoding support, converting addresses and coordinates to structured results, with configurable endpoints and HTTP client integration for Laravel/PHP apps.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Provider for Nominatim

Frequently asked questions about Nominatim Provider
How do I integrate Nominatim geocoding into a Laravel app?
Install via Composer (`composer require geocoder-php/nominatim-provider`), then configure the provider in `config/services.php` under the `geocoder` key. Use the Geocoder facade to geocode addresses or reverse coordinates, like `Geocoder::geocode('123 Main St')` or `Geocoder::reverse($latitude, $longitude)`.
What Laravel versions does this package support?
The package works with Laravel 5.5+ and PHP 7.2+. It’s framework-agnostic but leverages Laravel’s Service Container and config system for seamless integration. No Laravel-specific dependencies exist beyond the base PHP requirements.
Can I use a custom Nominatim endpoint instead of the default?
Yes. Configure a custom host in your `.env` file with `NOMINATIM_HOST` (e.g., `https://your-nominatim-instance.com`) or directly in `config/services.php` under the `nominatim` provider array. This is useful for self-hosted Nominatim instances or regional endpoints.
How do I handle Nominatim’s rate limits (1 request/sec, 1M/day)?
Use Geocoder’s built-in PSR-6 cache (e.g., Redis) to store results. Implement exponential backoff in your HTTP client (Guzzle/Symfony) for retries. For high-volume apps, consider a local geocoder like `geocoder-php/geocoder` with a different provider or a paid API.
Does this package support reverse geocoding (coordinates to address)?
Yes. Use the `reverse()` method on the Geocoder facade: `Geocoder::reverse($latitude, $longitude)`. It returns structured address objects with fields like `street`, `city`, and `postcode`, parsed from Nominatim’s API response.
Can I mock Nominatim for testing in Laravel?
Absolutely. Use Laravel’s HTTP client mocking or PHPUnit’s `HttpClient::fake()` to simulate Nominatim responses. For unit tests, mock the `Nominatim` provider directly or use Geocoder’s test utilities to verify address/coordinate conversions without hitting the API.
What are the alternatives if Nominatim’s accuracy or limits are problematic?
Consider paid APIs like Google Maps Geocoding API or Mapbox Geocoding for higher reliability and commercial use. For open-source alternatives, try `geocoder-php/geocoder` with providers like `mapbox` or `google_maps`. Self-hosted solutions like `pelias` or `osm2pgrouting` offer more control.
How do I cache geocoding results to reduce API calls?
Configure a PSR-6 cache (e.g., Redis) in Laravel’s `config/cache.php`. Geocoder will automatically cache results for repeated queries. For example, add `'cache' => 'redis'` to your provider config to store responses and bypass Nominatim’s rate limits.
Is this package suitable for production use in a high-traffic Laravel app?
Nominatim is free but rate-limited (1 request/sec). For production, combine it with caching (Redis) and queue geocoding jobs (Laravel Queues) to avoid blocking requests. Monitor usage via logs and set up alerts for rate limit breaches. For mission-critical apps, a paid API may be more reliable.
How do I handle non-English addresses or regional localization?
Nominatim supports most languages, but accuracy varies by region. Test edge cases (e.g., non-Latin scripts, rural areas) in your app. For critical localization, consider a provider like Mapbox or Google Maps, which offer better global coverage. Always validate results against user input for critical features.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky