city
This module provides a dictionary of over 9,000 world cities.
Import
Import the dictionary to your project via the require
tag:
require: city/cityEn.sc
module = sys.zb-common
After importing the file, the following becomes available:
- the
$Cities
named entity dictionary; - the
$City
named entity for processing city names with patterns.
Value format
Field | Type | Description |
---|---|---|
name | String | City name |
lat | Number | Latitude |
lon | Number | Longitude |
country | String | ISO 3166-1 alpha-2 country code |
timezone | String | Time zone conforming to the Java specification |
population | Number | Population in 2017 |
Entry examples
2082;Seattle;{"name": "Seattle", "lat": 47.60621, "lon": -122.33207, "country": "US", "timezone": "America/Los_Angeles", "population": 608660}
4551;Osaka;{"name": "Osaka", "lat": 34.69374, "lon": 135.50218, "country": "JP", "timezone": "Asia/Tokyo", "population": 2592413}
tip
Learn how to use this dictionary by walking through the Last Letter game bot tutorial.