geocode
1.0.3, released 3 years ago by imanol.dev
Package to translate coordinates into locations and addresses into coordinates.
What it does
It provides a basic implementation of the geocode.xyz API in Dart. It exposes two main methods: forward geocoding to translate an address into latitude and longitude coordinates, and reverse geocoding to translate coordinates into a real address.
AI-written summary of version 1.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to convert a physical street address into geographic coordinates.
- You need to look up a street address or location details from latitude and longitude coordinates.
Skip it when
- You require an offline geocoding solution, as this package makes network requests to geocode.xyz.
- You need high-volume requests without considering the rate limits and pricing plans of the underlying API.
Strengths
- Simple and straightforward API for forward and reverse geocoding.
- Includes helpful typed exceptions for handling common error states like throttled requests or empty results.
Weaknesses
- Relies on a third-party web service (geocode.xyz) which has strict free-tier rate limits.
- Not documented for offline use.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Not documented
import 'package:geocode/geocode.dart';
void main() async {
GeoCode geoCode = GeoCode();
try {
Coordinates coordinates = await geoCode.forwardGeocoding(
address: "532 S Olive St, Los Angeles, CA 90013");
print("Latitude: ${coordinates.latitude}");
print("Longitude: ${coordinates.longitude}");
} catch (e) {
print(e);
}
}Alternatives
Packages that do the same job and could replace geocode.
- location_web
Web implementation of the location plugin for Flutter web.
74Compare - geomag
Translate GPS location data to geo-magnetic data such as magnetic declination.
60Compare - yandex_geocoder
API to translate geographic coordinates into an address and vice versa using Yandex.
50Compare - carp_background_location
Background location tracking for Android and iOS using background_locator_2
50Compare