{"id":13536247,"url":"https://github.com/kakuilan/china_area_mysql","last_synced_at":"2025-05-14T13:07:52.926Z","repository":{"id":41181614,"uuid":"53032898","full_name":"kakuilan/china_area_mysql","owner":"kakuilan","description":"中国5级行政区域mysql库","archived":false,"fork":false,"pushed_at":"2024-07-29T01:38:13.000Z","size":240614,"stargazers_count":5245,"open_issues_count":29,"forks_count":1232,"subscribers_count":193,"default_branch":"master","last_synced_at":"2025-04-12T20:43:26.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kakuilan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-03-03T08:10:02.000Z","updated_at":"2025-04-12T02:36:41.000Z","dependencies_parsed_at":"2024-01-14T02:36:45.702Z","dependency_job_id":"5dc6eb8b-166b-4c60-b752-383ec449f238","html_url":"https://github.com/kakuilan/china_area_mysql","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakuilan%2Fchina_area_mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakuilan%2Fchina_area_mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakuilan%2Fchina_area_mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakuilan%2Fchina_area_mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kakuilan","download_url":"https://codeload.github.com/kakuilan/china_area_mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149959,"owners_count":22022851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T09:00:36.402Z","updated_at":"2025-05-14T13:07:47.912Z","avatar_url":"https://github.com/kakuilan.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# china_area_mysql\n\n注意：`cnarea_2023`在2020基础上有增减， 增出来的数据merger_name，lng，lat等字段有待完善，感谢@youwen21的贡献。\n\n## 中国5级行政区域mysql库\n\n爬取国家统计局官网的行政区域数据,包括省市县镇村5个层级;\n\n港澳地区的数据只有3级;台湾地区4级;\n\n包含大陆地区的邮政编码和经纬度信息.\n  \n---------------------------------------\n\n##### cnarea20200630.7z 是爬取2020年的数据,截止2020年6月30日.\n\n全部共 **758049** 条\n\n- 大陆数据共**679237** 条,其中\n    - 省/直辖市 `31`\n    - 市/州 `342`\n    - 县/区 `3348`\n    - 乡/镇 `42757`\n    - 村/社区 `632759`\n\n- 港澳台数据共**78812** 条,其中\n    - 省/特区 `3`\n    - 港澳辖区 `33`\n    - 台湾市/县 `23`\n    - 台湾区/镇 `371`\n    - 台湾街道/村 `78384`\n\n- 改动:\n    - 2020比2019的数据少了25513条记录\n    - 具体说明见 [#56](https://github.com/kakuilan/china_area_mysql/issues/56)\n\n### 表结构\n\n```mysql\n\nCREATE TABLE `cnarea_2023`\n(\n    `id`          mediumint(7) unsigned          NOT NULL AUTO_INCREMENT,\n    `level`       tinyint(1) unsigned            NOT NULL COMMENT '层级',\n    `parent_code` bigint(14) unsigned            NOT NULL DEFAULT '0' COMMENT '父级行政代码',\n    `area_code`   bigint(14) unsigned            NOT NULL DEFAULT '0' COMMENT '行政代码',\n    `zip_code`    mediumint(6) unsigned zerofill NOT NULL DEFAULT '000000' COMMENT '邮政编码',\n    `city_code`   char(6)                        NOT NULL DEFAULT '' COMMENT '区号',\n    `name`        varchar(50)                    NOT NULL DEFAULT '' COMMENT '名称',\n    `short_name`  varchar(50)                    NOT NULL DEFAULT '' COMMENT '简称',\n    `merger_name` varchar(50)                    NOT NULL DEFAULT '' COMMENT '组合名',\n    `pinyin`      varchar(30)                    NOT NULL DEFAULT '' COMMENT '拼音',\n    `lng`         decimal(10, 6)                 NOT NULL DEFAULT '0.000000' COMMENT '经度',\n    `lat`         decimal(10, 6)                 NOT NULL DEFAULT '0.000000' COMMENT '纬度',\n    PRIMARY KEY (`id`),\n    UNIQUE KEY `uk_code` (`area_code`) USING BTREE,\n    KEY `idx_parent_code` (`parent_code`) USING BTREE\n) ENGINE = MyISAM\n  DEFAULT CHARSET = utf8 COMMENT ='中国行政地区表';\n```\n\n### 最快的导入方式\n\n\u003e mysql -h127.0.0.1 -uroot -proot -D your_db  \u003c /Users/owen/Downloads/cnarea_2023.sql\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkakuilan%2Fchina_area_mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkakuilan%2Fchina_area_mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkakuilan%2Fchina_area_mysql/lists"}