nominatim_geocoding 0.0.6 nominatim_geocoding: ^0.0.6 copied to clipboard
A library to forward and reverse geocoding using OSM nominatim API.
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.