uzgeocoder 0.3.0 copy "uzgeocoder: ^0.3.0" to clipboard
uzgeocoder: ^0.3.0 copied to clipboard

Offline reverse geocoder for Uzbekistan. Converts latitude and longitude to region (viloyat) and district (tuman) enums and the nearest street. Pure Dart.

example/example.dart

import 'package:uzgeocoder/uzgeocoder.dart';

void main() {
  // Latitude first, then longitude.
  final loc = locate(41.2856, 69.2036);
  if (loc == null) {
    print('Outside Uzbekistan');
    return;
  }
  print(loc.region); // Toshkent shahri
  print(loc.district); // Chilonzor tumani
  print(loc.district.soato); // 1726294
  print(loc.district.cadastreCode); // 10:03

  // Nearest street (OpenStreetMap data: credit "© OpenStreetMap contributors").
  final street = locateStreet(40.3864, 71.7864, lang: Lang.ru); // Fergana
  print(street); // Маърифат улица, 43А

  // Names in another language.
  final ru = locate(41.2856, 69.2036, lang: Lang.ru)!;
  print(ru.regionName); // город Ташкент
  print(ru.districtName); // Чиланзарский район
  print(loc.district.nameIn(Lang.en)); // Chilanzar District

  switch (loc.region) {
    case Region.toshkentShahri:
      print('Tashkent city');
    default:
      print('Elsewhere');
  }
}
0
likes
0
points
--
downloads

Publisher

unverified uploader

Weekly Downloads

Offline reverse geocoder for Uzbekistan. Converts latitude and longitude to region (viloyat) and district (tuman) enums and the nearest street. Pure Dart.

Repository (GitHub)
View/report issues

Topics

#geocoding #uzbekistan #openstreetmap #location #offline

License

unknown (license)

More

Packages that depend on uzgeocoder