All Projects → issue9 → cnregion

issue9 / cnregion

Licence: MIT license
2009-2021 年中国全国(省、市、县、乡/镇、村/街道)五级行政区域数据

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to cnregion

Openki
We moved to GitLab 💔 Openki is a tool to build up and organize local communities – Open education for real.
Stars: ✭ 137 (-11.04%)
Mutual labels:  region
China
🇨🇳 一个轻巧的中国的地区、民族以及节假日信息的查询PHP库
Stars: ✭ 51 (-66.88%)
Mutual labels:  region
UniverseGuard2
An easy to use world protection plugin for Sponge
Stars: ✭ 17 (-88.96%)
Mutual labels:  region
Diffre
Neon Progress indicator useful for event progress like views. Proof of concept.
Stars: ✭ 176 (+14.29%)
Mutual labels:  region
Laravel World
provide countries, states, and cities relations and database.
Stars: ✭ 222 (+44.16%)
Mutual labels:  region
popoto-examples
Contains a list of Popoto.js examples
Stars: ✭ 121 (-21.43%)
Mutual labels:  region
Wavefile
Create, read and write wav files according to the specs. ⭐️ 🎶 ❤️
Stars: ✭ 100 (-35.06%)
Mutual labels:  region
cosmogony
easy to use & easy to update geographic regions
Stars: ✭ 90 (-41.56%)
Mutual labels:  region
AdBlock-Acceleration
Accelerated subscription for international/China region ad filtering rules(国际/中国地区广告过滤规则的加速订阅)
Stars: ✭ 327 (+112.34%)
Mutual labels:  region
IP2Location-C-Library
IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
Stars: ✭ 37 (-75.97%)
Mutual labels:  region
Nativescript Mapbox
🗽 🗼 🗻 Native OpenGL powered Maps, by Mapbox
Stars: ✭ 187 (+21.43%)
Mutual labels:  region
Openapi Sdk Php Client
Official repository of the Alibaba Cloud Client for PHP
Stars: ✭ 206 (+33.77%)
Mutual labels:  region
DrupalTwigFood
Useful functions, filters for twig @ Drupal 8
Stars: ✭ 1 (-99.35%)
Mutual labels:  region
Brpickerview
BRPickerView 封装的是iOS中常用的选择器组件,主要包括:日期选择器(支持年月日、年月等15种日期样式选择,支持设置星期、至今等)、地址选择器(支持省市区、省市、省三种地区选择)、自定义字符串选择器(支持单列、多列、二级联动、三级联动选择)。支持自定义主题样式,适配深色模式,支持将选择器组件添加到指定容器视图。
Stars: ✭ 2,149 (+1295.45%)
Mutual labels:  region
IP2Location-PHP-Module
This module is a PHP module that enables the user to find the country, region, city, coordinates, zip code, ISP, domain name, timezone, connection speed, IDD code, area code, weather station code, weather station name, mobile, usage types, address type, IAB category, etc that any IP address or host name originates from.
Stars: ✭ 154 (+0%)
Mutual labels:  region
State
Finite state machine for TypeScript and JavaScript
Stars: ✭ 118 (-23.38%)
Mutual labels:  region
regions
Astropy package for region handling
Stars: ✭ 52 (-66.23%)
Mutual labels:  region
Overseer
Tool for analyzing Starcraft 2 maps by region decomposition
Stars: ✭ 13 (-91.56%)
Mutual labels:  region
qqmap-region
腾讯位置服务中国标准行政区划数据 SDK
Stars: ✭ 22 (-85.71%)
Mutual labels:  region
ip2location-nginx
Nginx module that allows user to lookup for geolocation information using IP2Location database.
Stars: ✭ 33 (-78.57%)
Mutual labels:  region

cnregion

Test Go version PkgGoDev codecov License

历年统计用区域和城乡划分代码,数据来源于 http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/。 符合国家标准 GB/T 2260 与 GB/T 10114。

从 0.3.0 开始引入了 io/fs 和 embed 两个包,只支持 go1.16 以之后的版本

关于版本号,主版本号代码不兼容性更改,次版本号代码最后一次生成的数据年份,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 中。 你可以直接使用 go1.16 中的 //go:embed 嵌入到代码中,也可以采用 cnregion.LoadFile 从外部加载。

安装

go get github.com/issue9/cnregion

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].