https://github.com/modulovalue/cities.dart
A dataset containing 2.6 million cities that can be used by benchmarks or demos. Zero third party dependencies and completely self-contained.
https://github.com/modulovalue/cities.dart
Last synced: 3 months ago
JSON representation
A dataset containing 2.6 million cities that can be used by benchmarks or demos. Zero third party dependencies and completely self-contained.
- Host: GitHub
- URL: https://github.com/modulovalue/cities.dart
- Owner: modulovalue
- License: mit
- Created: 2022-05-25T12:33:50.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-30T10:56:42.000Z (11 months ago)
- Last Synced: 2024-12-31T08:12:08.004Z (5 months ago)
- Language: Dart
- Size: 29.9 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pub.dev/packages/extra_pedantic) [](https://pub.dartlang.org/packages/cities) [](https://github.com/modulovalue/cities.dart/blob/master/LICENSE) [](https://github.com/modulovalue/cities.dart) [](https://twitter.com/modulovalue) [](https://github.com/modulovalue)
# cities.dart
A dataset containing over 2 million real cities that can be used by benchmarks or demos.
It has zero third party dependencies and is completely self-contained.```yaml
cities: *insert-newest-version-here*
``````dart
import 'package:cities/cities.dart';Future main() async {
final cities = await cities_auto();
final all_cities = cities.all;
final first_ten_cities = all_cities.take(10);
for (final city in first_ten_cities) {
print(
city.debug_string(),
);
// CityImpl(country: "ad", city: "aixas", accent_city: "Aixàs", region: "06", latitude: 42.4833333, longitude: 1.4666667)
// CityImpl(country: "ad", city: "aixirivali", accent_city: "Aixirivali", region: "06", latitude: 42.4666667, longitude: 1.5)
// CityImpl(country: "ad", city: "aixirivall", accent_city: "Aixirivall", region: "06", latitude: 42.4666667, longitude: 1.5)
// CityImpl(country: "ad", city: "aixirvall", accent_city: "Aixirvall", region: "06", latitude: 42.4666667, longitude: 1.5)
// CityImpl(country: "ad", city: "aixovall", accent_city: "Aixovall", region: "06", latitude: 42.4666667, longitude: 1.4833333)
// CityImpl(country: "ad", city: "andorra", accent_city: "Andorra", region: "07", latitude: 42.5, longitude: 1.5166667)
// CityImpl(country: "ad", city: "andorra la vella", accent_city: "Andorra la Vella", region: "07", latitude: 42.5, longitude: 1.5166667)
// CityImpl(country: "ad", city: "andorra-vieille", accent_city: "Andorra-Vieille", region: "07", latitude: 42.5, longitude: 1.5166667)
// CityImpl(country: "ad", city: "andorre", accent_city: "Andorre", region: "07", latitude: 42.5, longitude: 1.5166667)
// CityImpl(country: "ad", city: "andorre-la-vieille", accent_city: "Andorre-la-Vieille", region: "07", latitude: 42.5, longitude: 1.5166667)
}
}```