Giter VIP home page Giter VIP logo

xiangyuecn / areacity-jsspider-statsgov Goto Github PK

View Code? Open in Web Editor NEW
5.6K 5.6K 913.0 4.81 MB

省市区县乡镇三级或四级城市数据,带拼音标注、坐标、行政区域边界范围;2024年06月16日最新采集,提供csv格式文件,支持在线转成多级联动js代码、通用json格式,提供软件转成shp、geojson、sql、导入数据库;带浏览器里面运行的js采集源码,综合了中华人民共和国民政部、国家统计局、高德地图、腾讯地图行政区划数据

Home Page: https://xiangyuecn.github.io/AreaCity-JsSpider-StatsGov/

License: MIT License

JavaScript 69.05% Python 0.85% HTML 30.10%

areacity-jsspider-statsgov's Issues

利用geopandas和matplotlib绘制的地级行政区边界图存在错误的线条连接

如题所述,使用“【边界三级】省市区 坐标和边界 数据”绘制的地图如下:
output

其中**省的数据只选择了省一级。具体程序如下:

import pandas as pd
import geopandas as gpd
from shapely.geometry import Polygon
import matplotlib.pyplot as plt

data = pd.read_csv('geo.csv')
TaiWan = data.loc[data["name"] =="**省"]
no_TaiWan_citiies = data.loc[(data["deep"]==1) & (~data["ext_path"].str.contains("**省"))]
result = pd.concat([TaiWan,no_TaiWan_citiies])

def get_polygon(df: pd.DataFrame) -> gpd.GeoDataFrame:
    polygons = []
    for row in df['polygon']:
        row = row.replace(';', ",")
        coordinates = [tuple(map(float, coord.split())) for coord in row.split(',')]
        polygon = Polygon(coordinates)
        polygons.append(polygon)
    df['polygon'] = polygons
    return gpd.GeoDataFrame(df, geometry='polygon')

def draw_map(df: gpd.GeoDataFrame, title: str=None):
    fig, ax = plt.subplots(figsize=(10, 10))
    df.plot(ax=ax, color='white', edgecolor='black')
    ax.set_title(title)
    plt.show()

result_map = get_polygon(result)
draw_map(result_map, 'China')

四级数据错误

这个是国家统计局的数据。

image

这个是仓库下载的。

image

按照仓库中的说法四级数据的主要来源为腾讯地图,仓库中 110105232 为来广营,国家统计局中来广营为 110105032000,那哪个是正确的

字段polygon,类型geometry存在数据截断问题

在使用测试版本的数据导出成sql后,通过navicat直接导入到mysql 8.0.34,因为默认设置的字段长度为65535,因此多数的省直辖市的polygon的内容,都是在这个长度后被截断了。比如北京是在40.977926, 116.494002 40.9截断。
大佬有什么解决方式吗?

有误的地名

此issue主要更正行政区划名称中的错别字繁体。主要参考此处。个人认为,应该首先把错别字更正。

360824105,360824,3,"麦斜","m","mai xie","360824105000","麦斜镇"

麦斜镇-->麦㙦镇。

440883107,440883,3,"塘缀","t","tang zhui","440883107000","塘缀镇"

塘缀镇-->塘㙍镇。

510129106,510129,3,"出江","c","chu jiang","510129106000","出江镇"

出江镇-->䢺江镇。

522626001,522626,3,"_水","s","shui","522626001000","_水街道"

_水街道-->㵲水街道;shui-->wu shui。

441721100,441721,3,"织篢","z","zhi gong","441721100000","织篢镇"

织篢镇-->织𬕂镇。

450381107,450381,3,"花篢","h","hua gong","450381107000","花篢镇"

花篢镇-->花𬕂镇。

441521004,441521,3,"鮜门","h","hou men","441521004000","鮜门街道"

鮜门街道-->鲘门街道。

620502103,620502,3,"藉口","j","jie kou","620502103000","藉口镇"

藉口镇-->耤口镇。

211224114,211224,3,"鴜鹭树","c","ci lu shu","211224114000","鴜鹭树镇"

鴜鹭树镇-->𪉈鹭树镇。

440512001,440512,3,"礐石","q","que shi","440512001000","礐石街道"

礐石街道-->𬒈石街道。

440511006,440511,3,"鮀莲","t","tuo lian","440511006000","鮀莲街道"

鮀莲街道-->𬶍莲街道。

440511007,440511,3,"鮀江","t","tuo jiang","440511007000","鮀江街道"

鮀江街道-->𬶍江街道。

140830107,140830,3,"南磑","n","nan ai","140830107000","南磑镇"

南磑镇-->南硙镇。

411481104,411481,3,"酇城","c","cuo cheng","411481104000","酇城镇"

酇城镇-->酂城镇。

411481120,411481,3,"酇阳","c","cuo yang","411481120000","酇阳镇"

酇阳镇-->酂阳镇。

【完】

山东省威海市环翠区Màn山镇 地名疑误

371002112,371002,3,"苘山","q","qing shan","371002112000","苘山镇"

**·国家地名信息库显示“蔄山镇”,实际上此地现在使用简体“𬜬”与繁体“蔄”通用。“蔄山镇”也不是不可以,但是“苘山镇”就有点离谱。

Some 县s are missing

Sorry for using English... I currently cannot type Chinese on my laptop
Some of the 县s are missing. The missing items include:
**维吾尔自治区 昆玉市
**维吾尔自治区 五家渠市
**维吾尔自治区 可克达拉市
**维吾尔自治区 双河市
青海省 海西蒙古族藏族自治州 大柴旦行政委员会 (which is called "海西蒙古族藏族自治州 海西蒙古族藏族自治州直辖" in Amap)
It would be great if you could add these missing items. Thank you!

1_2_抓取民政部城市信息.js 按照里面的程序执行得出的数据只有省市

var Step1_2_Merge_MCA={
"statsGovYear": 2020,
"notFinds": [
{
"code": "110000000000",
"name": "北京市"
},
{
"code": "120000000000",
"name": "天津市"
},
{
"code": "130000000000",
"name": "河北省"
},
{
"code": "140000000000",
"name": "山西省"
},
{
"code": "150000000000",
"name": "内蒙古自治区"
},
{
"code": "210000000000",
"name": "辽宁省"
},
{
"code": "220000000000",
"name": "吉林省"
},
{
"code": "230000000000",
"name": "黑龙江省"
},
{
"code": "310000000000",
"name": "上海市"
},
{
"code": "320000000000",
"name": "江苏省"
},
{
"code": "330000000000",
"name": "浙江省"
},
{
"code": "340000000000",
"name": "安徽省"
},
{
"code": "350000000000",
"name": "福建省"
},
{
"code": "360000000000",
"name": "江西省"
},
{
"code": "370000000000",
"name": "山东省"
},
{
"code": "410000000000",
"name": "河南省"
},
{
"code": "420000000000",
"name": "湖北省"
},
{
"code": "430000000000",
"name": "湖南省"
},
{
"code": "440000000000",
"name": "广东省"
},
{
"code": "450000000000",
"name": "广西壮族自治区"
},
{
"code": "460000000000",
"name": "海南省"
},
{
"code": "500000000000",
"name": "重庆市"
},
{
"code": "510000000000",
"name": "四川省"
},
{
"code": "520000000000",
"name": "贵州省"
},
{
"code": "530000000000",
"name": "云南省"
},
{
"code": "540000000000",
"name": "西藏自治区"
},
{
"code": "610000000000",
"name": "陕西省"
},
{
"code": "620000000000",
"name": "甘肃省"
},
{
"code": "630000000000",
"name": "青海省"
},
{
"code": "640000000000",
"name": "宁夏回族自治区"
},
{
"code": "650000000000",
"name": "**维吾尔自治区"
}
],
"notFindsIgnore": [],
"cityList": [
{
"name": "北京市",
"code": "110000000000",
"child": []
},
{
"name": "天津市",
"code": "120000000000",
"child": []
},
{
"name": "河北省",
"code": "130000000000",
"child": []
},
{
"name": "山西省",
"code": "140000000000",
"child": []
},
{
"name": "内蒙古自治区",
"code": "150000000000",
"child": []
},
{
"name": "辽宁省",
"code": "210000000000",
"child": []
},
{
"name": "吉林省",
"code": "220000000000",
"child": []
},
{
"name": "黑龙江省",
"code": "230000000000",
"child": []
},
{
"name": "上海市",
"code": "310000000000",
"child": []
},
{
"name": "江苏省",
"code": "320000000000",
"child": []
},
{
"name": "浙江省",
"code": "330000000000",
"child": []
},
{
"name": "安徽省",
"code": "340000000000",
"child": []
},
{
"name": "福建省",
"code": "350000000000",
"child": []
},
{
"name": "江西省",
"code": "360000000000",
"child": []
},
{
"name": "山东省",
"code": "370000000000",
"child": []
},
{
"name": "河南省",
"code": "410000000000",
"child": []
},
{
"name": "湖北省",
"code": "420000000000",
"child": []
},
{
"name": "湖南省",
"code": "430000000000",
"child": []
},
{
"name": "广东省",
"code": "440000000000",
"child": []
},
{
"name": "广西壮族自治区",
"code": "450000000000",
"child": []
},
{
"name": "海南省",
"code": "460000000000",
"child": []
},
{
"name": "重庆市",
"code": "500000000000",
"child": []
},
{
"name": "四川省",
"code": "510000000000",
"child": []
},
{
"name": "贵州省",
"code": "520000000000",
"child": []
},
{
"name": "云南省",
"code": "530000000000",
"child": []
},
{
"name": "西藏自治区",
"code": "540000000000",
"child": []
},
{
"name": "陕西省",
"code": "610000000000",
"child": []
},
{
"name": "甘肃省",
"code": "620000000000",
"child": []
},
{
"name": "青海省",
"code": "630000000000",
"child": []
},
{
"name": "宁夏回族自治区",
"code": "640000000000",
"child": []
},
{
"name": "**维吾尔自治区",
"code": "650000000000",
"child": []
}
]
}

缺少直辖县分级

数据中没有直辖县分级,比如湖北天门,国家划分为湖北直辖天门

求助大佬

大佬,我想生成一个 带有全字段的json导出为JSON对象
id,pid,deep,name,pinyin_prefix,pinyin,ext_id,ext_name

我把UserFormat修改了好像不起效果(其实修改的对不对自己心里也没谱,菜鸡看不太懂js代码)
大佬你能帮我修改一下UserFormat吗

几个镇街级数据调整

对文件ok_data_level3-4.csv进行了核实:

  1. 440113102000,石碁镇,而不是石基镇。
  2. 郑州市中牟县大孟镇,撤镇设街了;
  3. 厦门市同安区新民镇,撤镇设街了;
  4. 厦门市同安区西柯镇,撤镇设街了,等等。2-4见2022年中华人民共和国县以下行政区划代码变更情况。2-4这几条出现问题,大概率是没有参考我给的这个链接。其余的没有再查,相信经我这个链接核实后,文件的准确性会更高。

广东省云浮市罗定市Liǎng塘镇 地名疑误

445381106,445381,3,"满塘","m","man tang","445381106000","满塘镇"

以下是百度百科上“罗定市”词条的“行政区划一览表”。在表格中此地名是“䓣塘镇”。**·国家地名信息库亦显示“䓣塘镇”。

罗城街道 | 素龙街道 | 附城街道 | 双东街道
罗镜镇 | 太平镇 | 分界镇 | 罗平镇
船步镇 | 䓣塘镇 | 苹塘镇 | 金鸡镇
围底镇 | 华石镇 | 榃滨镇 | 生江镇
黎少镇 | 连州镇 | 泗纶镇 | 加益镇
龙湾镇 | 罗平农场 | - | -

现在此地“䓣”与“𬜯”混用。类似,读音应作“liang tang”。

珠江三角洲地区的第4级边界

大佬能否提供一下珠江三角洲地区城市(如深圳、广州、东莞、中山、珠海、江门、佛山等)的第四级的边界划分数据。谢谢大佬~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.