Nominatim Geocoding
Flutter package to get forward and reverse geocoding.
Features
- Automatically stores cache upto n number of requests.
- Restriction: Only 1 request per second is allowed to send.
Steps use
Add dependency in pubspec.yaml
file as
nominatim_geocoding: 0.0.6
Initialize the package
void main() async {
await NominatimGeocoding.init(reqCacheNum: 20);
}
Forward Geocoding
Geocoding geocoding = await NominatimGeocoding.to.forwardGeoCoding(
const Address(
city: 'Braunschweig',
postalCode: 38120,
),
);
Reverse Geocoding
Coordinate coordinate = Coordinate(latitude: 52.567898, longitude: 30.887776);
Geocoding geocoding = await NominatimGeocoding.to.reverseGeoCoding(coordinate);
Additional information
- OSM Nominatim Open-Source API https://nominatim.org/release-docs/develop/ is used for geocoding.
- Uses plugin to store cache.
- plugin is used for API calls.
Libraries
- nominatim_geocoding
- nominatim_geocoding package provides two function for forward geocoding and reverse geocoding. Both functions return Geocoding which contains Address and Coordinate.