历年统计用区划代码和城乡划分代码,数据来源于 http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/。
v, err := cnregion.LoadFile("./data/regions.db", "-", 2020)
p := v.Provinces() // 返回所有省列表
cities := p[0].Items() // 返回该省下的所有市
counties := cities[0].Items() // 返回该市下的所有县
towns := counties[0].Items() // 返回所有镇
villages := towns[0].Items() // 所有村和街道信息
d := v.Districts() // 按以前的行政大区进行划分
provinces := d[0].Items() // 该大区下的所有省份
list := v.Search("温州", nil) // 按索地名中带温州的区域列表
go get github.com/issue9/cnregion