2 Star 0 Fork 15

YountMan / zone-spider

forked from jjxliu306 / zone-spider 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

zone-spider

介绍

根据国家统计局网站爬取最新行政区划数据,包含省、市、区县、乡镇/街道、村/社区 5级数据。

数据来源

http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/ 国家统计局官方网站

使用说明

将项目直接导入eclipse,idea等工具后运行App.java 即可。

目录2020中为2020年国家统计局中1-4级的数据(省-市-区县-街道/乡镇)。 目录2021中为2021年国家统计局中1-4级的数据(省-市-区县-街道/乡镇)。

功能

  1. 可以从任意一级开始爬取,可以指定最多爬取层级,譬如只爬取西安市下所有的区县和街道/乡镇,不需要获取到村级。
  2. 多线程调度,线程数量可以自定义。
  3. 输出格式包含csv和sql语句,方便使用。

输出格式

1、CSV

区划代码 区划名称 区划层级 上级区划代码
610100000000 西安市 2 610000000000

2、SQL

 
create table sys_zone (

	code	varchar(12) primary key , 	-- 区划代码
	name	varchar(100) ,				--区划名称
	level	int , 						-- 区划层级1-省 2-地市 3-区县 4-乡镇/街道 5-社区/村
	parent_code	varchar(12)				-- 上级区划代码
 
);
MIT License Copyright (c) 2021 jjxliu306 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

根据国家统计局网站爬取最新行政区划数据,包含省、市、区县、乡镇/街道、村/社区 5级数据。 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/YountMan/zone-spider.git
git@gitee.com:YountMan/zone-spider.git
YountMan
zone-spider
zone-spider
master

搜索帮助