[数据][json格式] 2016年统计用区划代码和城乡划分代码
2017-12-21 14:13
1876 查看
[数据][json格式] 2016年统计用区划代码和城乡划分代码
2013 年的时候写过一篇 [数据][xml格式] 2012年统计用区划代码和城乡划分代码。到了今天,我需要某省的省市县乡村五级数据,因此在上文基础上简单改了改,做成了 JSON 格式,代码主体还是原来的,代码中的 JSOUP 选择器仍然适用,没变化。
数据来源: http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2016/index.html
一共32个文件,其中一个是【全国数据.json】,包含了上述网址中的全部数据(包含省一级数据)。
其他是各个省独立的数据,这些数据不包含省一级的数据,都是从市级开始。
部分数据展示:
[ { "name": "石家庄市", "href": "http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2016/13/1301.html", "code": "130100000000", "type": "CITY", "level": 2, "children": [ { "name": "市辖区", "code": "130101000000", "type": "COUNTY", "level": 3 }, { "name": "长安区", "href": "http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2016/13/01/130102.html", "code": "130102000000", "type": "COUNTY", "level": 3, "children": [ { "name": "建北街道办事处", "href": "http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2016/13/01/02/130102001.html", "code": "130102001000", "type": "TOWN", "level": 4, "children": [ { "name": "棉一社区居民委员会", "code": "130102001001", "type": "111", "level": 5 }, { "name": "光华路社区居民委员会", "code": "130102001002", "type": "111", "level": 5 }, { "name": "八家庄社区居民委员会", "code": "130102001003", "type": "111", "level": 5 }, { "name": "花园社区居民委员会", "code": "130102001004", "type": "111", "level": 5 }, { "name": "谈西社区居民委员会", "code": "130102001010", "type": "111", "level": 5 }, { "name": "谈后社区居民委员会", "code": "130102001011", "type": "111", "level": 5 }, { "name": "新浩城社区居民委员会", "code": "130102001012", "type": "111", "level": 5 }, { "name": "国赫红珊湾社区居民委员会", "code": "130102001013", "type": "111", "level": 5 } ] },
使用上面数据的时候,可以直接使用下面POJO类进行反序列化(推荐 Gson)。
public class Area { private String name; private String href; private String code; /** * 来源: http://www.stats.gov.cn/tjsj/tjbz/200911/t20091125_8667.html * 111表示:主城区 * 112表示:城乡结合区 * 121表示:镇中心区 * 122表示:镇乡结合区 * 123表示:特殊区域 * 210表示:乡中心区 * 220表示:村庄 */ private String type; private Integer level; List<Area> children; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getHref() { return href; } public void setHref(String href) { this.href = href; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getType() { return type; } public void setType(String type) { this.type = type; } public Integer getLevel() { return level; } public void setLevel(Integer level) { this.level = level; } public List<Area> getChildren() { return children; } public void setChildren(List<Area> children) { this.children = children; } }
下载地址
链接: https://pan.baidu.com/s/1i58HgA5 密码: fw1i2017年12月22日 更新为 2016年数据。
相关文章推荐
- 数据类型和Json格式
- 常用数据格式xml和json解析
- Java中将JSON格式的数据转换成对应的Bean、Map、List数据
- Javascript解析JSON 输出为bootstrip可用的特定格式的数据
- 【自制工具类】struts返回json数据包装格式类
- 使用 C++ 处理 JSON 数据交换格式
- JSON 数据格式解析
- EasyNet.Solr系列:处理xml或者json格式返回数据
- JSON(四)——异步请求中前后端使用Json格式的数据进行交互
- JavaScript学习总结(六)数据类型和JSON格式
- [转]在.NET使用JSON作为数据交换格式
- 稳扎稳打Silverlight(19) - 2.0通信之调用REST服务,处理JSON格式, XML格式, RSS/ATOM格式的数据
- Android上解析Json格式数据(一)
- JAVA 操作树返回JSON数据格式
- php将从数据库查询到的数据转化为json格式,并写入json文件中
- JSON 体验JSON (三)JSON 数据格式解析(转载)
- JavaScript原生xmlHttp与jquery的ajax方法json数据格式实例
- 数据类型和Json格式
- 前端页面中把form表单中的数据转换为json格式
- android 解析json数据格式