1 Star 0 Fork 235

Yufei Ren / 2022最新最全省市区街道json+sql

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

2022全网最完整、最新、最全、中国省市区街道sql/json 文件


效果演示

联动效果演示
国内备用演示

更新记录

  • 2022-02-14:增加github action,每日自动抓取最新数据,快速下载最新json/sql
  • 2022-02-13:增加golang版爬虫源码
  • 2022-02-08:增加PHP版爬虫源码
  • 2022-02-08master增加街道数据(4级联动),增加了香港、澳门、台湾、钓鱼岛相关数据~

分支说明

  • master分支:4级联动-包括省、市、区、街道
  • level5分支:5级联动-包括省、市、区、街道、社区,数据来源于国家统计局,数据比较old

目录结构描述

├── json                        // json文件目录
│   ├── province.json           // 省
│   ├── city.json               // 市
│   ├── area.json               // 区
│   └── street.json             // 街道
├── sql                         // mysql文件目录
│   ├── province.sql            // 省
│   ├── city.sql                // 市
│   ├── area.sql                // 区
│   ├── street.sql              // 街道
│   └── init.sql                // mysql表结构文件, 需要4张表
├── spider                      // 爬虫源文件目录
│   ├── go                      // golang版爬虫
│   │   ├── main.go             // demo入口文件
│   │   └── core                // 核心类库文件
│   └── php                     // php版爬虫
│       ├── index.php           // demo入口文件
│       └── Region.class.php    // 核心类库文件
├── docs                        // github联动效果演示文件,忽略
├── LICENSE                     // MIT
└── Readme.md                   // help

如何抓取最新数据

1.使用PHP版爬虫

clone项目后 直接执行 php spider/php/index.php 耗时约180s

2.使用golang版爬虫

clone项目后 直接执行 GO111MODULE=off go run spider/go/main.go 耗时约30s


执行后会在当前目录生成最新json/sql文件

其他说明

# 导入sql时报错时可以尝试以下方式导入
mysql -uroot -p --default-character-set=utf8 dbname < /path/community.sql

有问题请提issue,持续更新中.........

其他项目

美女图相册 (微信小程序) :海量高清美女图,宅男福利:-)
淘宝领券助手(浏览器插件) :PC购物党必备,自动解析出淘宝京东优惠券级历史价格,购物不吃亏~
花子领券助手(微信小程序) :一个领全网优惠券的小程序,包括外卖、打车、电影、淘宝、京东等优惠券

打个广告

生活不易,打个广告:作者业余兼职开发小程序、网站、商城、APP,有需要的请加我微信 gaohuazi520 ,请备注来意

MIT License Copyright (c) 2018 gaohuazi 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.

简介

2022最新最全省市区街道sql/json 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/yren/china_regions.git
git@gitee.com:yren/china_regions.git
yren
china_regions
2022最新最全省市区街道json+sql
master

搜索帮助