package com.mzl.flower.dto.map.gaode;
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
import com.google.gson.annotations.JsonAdapter;
|
import com.mzl.flower.dto.map.tengxun.TengxunLocation;
|
import lombok.AllArgsConstructor;
|
import lombok.Data;
|
import lombok.NoArgsConstructor;
|
|
import java.util.List;
|
|
// 行政区划对象
|
|
/**
|
* 代码共6位,前两位代表省(一级)、中间两位为市/地区(二级),最后两位为区县(三级)
|
* 1)省级:前两位有值,后4位置0,如,河北省:130000
|
* 2)市/地区:前4四位有值,包含省代码与市代码,最后两位置0,如河北省保定市:130600
|
* 3)区县:6位全有值,包含前4位省市代码及区县代码,河北省保定市涿州市:130681
|
* 4)直辖市、香港、澳门:
|
* 同省级,在行政区划接口(ws/district/v1/list)中,其下直接为区级(没有二级结构填充)
|
* 例:北京,东城区 (而非:“北京,北京,东城区”)
|
* 5)直辖县:第3、4位为90的,为省直辖县
|
* 6)中国范围内,省市区行政区划以外的区域值为999999(如中国东海)
|
* 7)东莞市、中山市、儋州市、嘉峪关市 因其下无区县级,因此增加了末位为99代码的同名子级,用于补齐到三级区划的结构
|
*
|
* 如何获取城市编码(city_code):
|
* 1)编码前4位不为0,第5、6位为0的,为常规城市,可直接取用
|
* 2)北京、上海、重庆、天津、香港、澳门,编码和省一致,需要单独提出
|
* 3)第3、4位为90的为省直辖县,一般当做城市来应用,也需要单独提出
|
*/
|
|
@Data
|
@NoArgsConstructor
|
@AllArgsConstructor
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
public class GaodeDistrict {
|
|
private String id;
|
/**
|
* 城市编码
|
*/
|
@JsonAdapter(CityCodeTypeAdapter.class)
|
private String citycode;
|
/**
|
* 区域编码
|
* 街道没有独有的 adcode,均继承父类(区县)的 adcode
|
*/
|
private String adcode;
|
/**
|
* 行政区名称
|
*/
|
private String name;
|
|
/**
|
* 行政区边界坐标点
|
* 当一个行政区范围,由完全分隔两块或者多块的地块组
|
*
|
* 成,每块地的 polyline 坐标串以 | 分隔 。
|
*
|
* 如北京 的 朝阳区
|
*
|
*/
|
private String polyline;
|
|
|
/**
|
*
|
* 区域中心点
|
* 乡镇级别返回的center是边界线上的形点,其他行政级别返回的center不一定是中心点,若政府机构位于面内,则返回政府坐标,政府不在面内,则返回繁华点坐标
|
*/
|
private String center;
|
|
/**
|
* 行政区划级别
|
*
|
* country:国家
|
*
|
* province:省份(直辖市会在province显示)
|
*
|
* city:市(直辖市会在province显示)
|
*
|
* district:区县
|
*
|
* street:街道
|
*
|
*/
|
private String level;
|
|
/**
|
* 下级行政区列表,包含 district 元素
|
*/
|
private List<GaodeDistrict> districts;
|
|
/**
|
* 行政区划父级别唯一标识(adcode)
|
*/
|
private String parentId;
|
}
|