Cnregion
2009-2023 年中国全国(省、市、县、乡/镇、村/街道)五级行政区域划分数据
Install / Use
/learn @issue9/CnregionREADME
cnregion
历年统计用区域和城乡划分代码,数据来源于 https://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/。 符合国家标准 GB/T 2260 与 GB/T 10114。
关于版本号,主版本号代码不兼容性更改,次版本号代码最后一次生成的数据年份,BUG 修正和兼容性的功能增加则增加修订版本号。
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(&SearchOptions{Text: "温州"}) // 按索地名中带温州的区域列表
对采集的数据进行了一定的加工,以减少文件的体积,文件保存在 ./data/regions.db 中。
安装
go get github.com/issue9/cnregion/v2
版权
Related Skills
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
339.3kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
