uzgeocoder 0.4.0 copy "uzgeocoder: ^0.4.0" to clipboard
uzgeocoder: ^0.4.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); // Qatortol ko‘chasi, Chilonzor tumani, Toshkent shahri
  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
155
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

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

MIT (license)

More

Packages that depend on uzgeocoder