Skip to content

Commit

Permalink
zoning 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
netnr committed Jan 11, 2022
1 parent 69809ad commit a08b7f9
Show file tree
Hide file tree
Showing 48,875 changed files with 40 additions and 151,308 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 更新日志

### [ⅴ2.2021.0] - 2021-12-30
- 2021 年数据发布

### [ⅴ2.0.20] - 2020-11-20
- 2020 年数据发布,对应`npm`版本号为`v2.0.20`
- 添加 境外(港澳台)数据
Expand Down
69 changes: 37 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
# zoning
中华人民共和国行政区划:省级、地级、县级、乡级和村级

> Demo: <https://ss.netnr.com/zoning>
> Gitee: <https://gitee.com/netnr/zoning>
> GitHub: <https://github.com/netnr/zoning>
> Demo: <https://ss.netnr.com/zoning>
### [变更日志](CHANGELOG.md)

### 来源

- **国家统计局 - 统计用区划和城乡划分代码**
- <http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/>
* 统计数据截止2020-06-30 于 2020-11-06发布
* <http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2020>

### 使用
- 打开页面 <http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm>
- 打开浏览器控制台(推荐Chrome、Firefox,请不要用IE系列,谢谢)
- 拷贝脚本`zoning.js`的内容粘贴到控制台运行
- 首次抓取会出现大量失败请求,再次抓取会从浏览器缓存获取,非常快
- Chrome比较快,会出现几个链接抓取失败
- Firefox比较稳定,抓取有保障,内存占用高(推荐,测试版本:61.0.2 64-bit)
-
- `build.html`用于导出的`JSON`文件生成`SQLite``CSV`
- `CSV`导出编码为`utf-8`,Excel打开中文会乱码,需要转换编码为`ANSI``指定BOM`
-
- [爬取截图1](https://s1.netnr.eu.org/2019/04/26/1345312e2a.jpg)[爬取截图2](https://s1.netnr.eu.org/2019/04/26/1345311bca.jpg)[爬取截图3](https://s1.netnr.eu.org/2019/04/26/134531735a.jpg)

### 发布
- 支持的格式有:`JSON`文件、`SQLite`数据库、`CSV`文件、`SQL`脚本
- `zoning-*.json`所有数据, `zoning-*.db`SQLite数据库, `zoning-*.csv`CSV文件,`zoning-*.sql`SQL脚本
- `dist/zoning-5` 五级
- `dist/zoning-4` 四级
- `dist/zoning-3` 三级
- npm,`npm install zoningjs`<https://unpkg.com/zoningjs/>

> [联系打赏](https://zme.ink)
统计用区划和城乡划分代码
<http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/>

统计数据截止 2021-10-31 于 2021-12-30 发布
<http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2021>

共 5 级

**0.json** 深度 1、2、3
**1101.json** 深度 4、5
**6590.json** 深度 4、5

**stats-zoning-3.json** 爬虫三级总数据 就是 **0.json**
**stats-zoning-4.json** 爬虫四级总数据
**stats-zoning-5.json** 爬虫五级总数据

```
npm install zoningjs
```

列信息

字段 | 类型 | 说明
---- | ---- | ----
id | string | 区划代码,唯一
txt | string | 名称
pid | string | 父级区划代码
sid | string | 简短区划代码,唯一
spid | string | 简短父级区划代码
ct | string | 城乡分类代码
num | int | 同级排序
leaf | int | 是叶节点(1:是;2:否)
deep | int | 爬取深度

> 爬取源码:https://github.com/netnr/stats
> [联系打赏](https://netnr.eu.org)
1 change: 0 additions & 1 deletion dist/zoning-3/0.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/11/11.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/11/1101.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/12/12.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/12/1201.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/13.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1301.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1302.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1303.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1304.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1305.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1306.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1307.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1308.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1309.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1310.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/13/1311.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/14.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1401.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1402.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1403.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1404.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1405.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1406.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1407.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1408.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1409.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1410.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/14/1411.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/zoning-3/15/15.json

This file was deleted.

Loading

0 comments on commit a08b7f9

Please sign in to comment.