Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

市级多余/错误数据 #70

Closed
bbgw opened this issue Apr 5, 2020 · 1 comment
Closed

市级多余/错误数据 #70

bbgw opened this issue Apr 5, 2020 · 1 comment

Comments

@bbgw
Copy link

bbgw commented Apr 5, 2020

现象

// 排除正确的市级地名
sqlite> select city.name, province.name from city \
   left join province \
   where city.name not like "%市%" \
      and city.name not like "%自治州%" \
      and city.name not like "%地区%" \
      and city.name not like "%盟%" \
      and city.provinceCode = province.code;                                                             
省直辖县级行政区划|河南省
省直辖县级行政区划|湖北省
省直辖县级行政区划|海南省
县|重庆市
自治区直辖县级行政区划|新疆维吾尔自治区

可以看到数据有多余。

Reference

  1. cities.csv 中239行数据不理解:“5002 '县' 50”  #42

PS. 借机感谢分享的劳动成果!

@modood
Copy link
Owner

modood commented Apr 8, 2020

@bbgw 你好,你很细心,感谢指出 😁这些数据数据确实存在,目前存到 sqlite 中的都是原始数据,因为这些市级数据底下包含县级,因此不能简单地把它们过滤掉,例如:海南省

你可以根据你的应用场景对数据进行恰当地处理,例如我在导出省市二级联动数据时会把这些名字没有太大参考性的市级过滤掉,以其县级数据补进。【参考代码

处理前的海南省市级数据:

[
  "海口市",
  "三亚市",
  "三沙市",
  "儋州市",
  "省直辖县级行政区划"
]

处理后的海南省市级数据:dist/pc.json

[
  "海口市",
  "三亚市",
  "三沙市",
  "儋州市",
  "五指山市",
  "琼海市",
  "文昌市",
  "万宁市",
  "东方市",
  "定安县",
  "屯昌县",
  "澄迈县",
  "临高县",
  "白沙黎族自治县",
  "昌江黎族自治县",
  "乐东黎族自治县",
  "陵水黎族自治县",
  "保亭黎族苗族自治县",
  "琼中黎族苗族自治县"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants