[数据][json格式] 2016年统计用区划代码和城乡划分代码

[数据][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 密码: fw1i

2017年12月22日 更新为 2016年数据。

猜你喜欢

转载自blog.csdn.net/isea533/article/details/78862295