geojson全国各省市区地图json数据
geojson全国各省市区地图json数据(目前仅到全国、省、市、区级别,无法到乡、镇、社区),现在尚未验证是高德or百度坐标系,预计阿里系应该是gcj-02坐标,有验证的小伙伴可回复下,嘿嘿
json数据获取地址:
http://datav.aliyun.com/tools/atlas/#&lat=31.769817845138945&lng=104.29901249999999&zoom=4
测试json数据地址,并且可以转化为shape格式文件:
https://mapshaper.org/
直接将json数据拖入即可,并可导出shape图层
全国的json数据,写了一个python程序获取下来了,有需要的可以下载来用:
python代码如下:
# 请求库
import requests
# 解析库
# from bs4 import BeautifulSoup
# 用于解决爬取的数据格式化
import io
import sys
import json
# 创建文件
# file_path:文件路径
# msg:即要写入的内容
def create_file(file_path, msg):
with open(file_path, "wt", encoding="utf-8") as out_file:
out_file.write(msg)
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
req = requests.get('https://geo.datav.aliyun.com/areas_v2/bound/100000_full.json')
req.encoding = 'utf-8'
result = json.loads(req.text)
# 写入文件
# with open('../geo_json/100000_全国_full.json', 'w') as file_obj:
# json.dump(result, file_obj)
dict_area = dict()
dict_area['100000'] = '全国'
# 可写入带格式化后的json对象
create_file('../geo_json/100000_full.json', req.text)
# 读取并加载json文件 json.loads(操作的是字符串),json.load()操作的是文件流
with open('../geo_json/100000_full.json', 'r', encoding="utf-8") as file_obj:
geo_json = json.load(file_obj)
print('read result is :')
print(geo_json)
features = geo_json["features"]
i = 0
for province_feature in features: # 循环各省
adcode = str(province_feature["properties"]["adcode"])
name = province_feature["properties"]["name"]
dict_area[adcode] = name
print('name{0} is {1}, adcode is {2}'.format(i, name, adcode))
i = i + 1
if adcode[4:] != '00': # 直辖市的下一级别直接是区,没有市级别
continue
# 省份的url_json获取,获取省,及省内城市json
province_full_url = 'https://geo.datav.aliyun.com/areas_v2/bound/{0}_full.json'.format(adcode)
province_full_json = json.loads(requests.get(province_full_url).text)
city_features = province_full_json["features"]
j = 0
for city_feature in city_features: # 循环各市
city_adcode = str(city_feature["properties"]["adcode"])
city_name = city_feature["properties"]["name"]
dict_area[city_adcode] = city_name
print('name{0}-{1} is {2}, adcode is {3}'.format(i, j, city_name, city_adcode))
j = j + 1
# 遍历字典
for area in dict_area.keys():
print('{}:{}', area, dict_area[area])
area_url = 'https://geo.datav.aliyun.com/areas_v2/bound/{0}.json'.format(area)
req = requests.get(area_url)
create_file('../geo_json/{0}_{1}.json'.format(area, dict_area[area]), req.text)
area_full_url = 'https://geo.datav.aliyun.com/areas_v2/bound/{0}_full.json'.format(area)
print(area_full_url)
req = requests.get(area_full_url)
if req.text.find("NoSuchKey") == -1:
create_file('../geo_json/{0}_{1}_full.json'.format(area, dict_area[area]), req.text)
# json文件说明
# 中国json https://geo.datav.aliyun.com/areas_v2/bound/100000.json
# 中国+各省市json https://geo.datav.aliyun.com/areas_v2/bound/100000_full.json
# 山东省边界json https://geo.datav.aliyun.com/areas_v2/bound/370000.json
# 山东省+省内地级市json https://geo.datav.aliyun.com/areas_v2/bound/370000_full.json
# 德州市边界json https://geo.datav.aliyun.com/areas_v2/bound/371400.json
# 德州市+内部辖区json https://geo.datav.aliyun.com/areas_v2/bound/371400_full.json
# create_file('../geo_json/full.json', result)
# 读取并加载json文件
geojson全国各省市区地图json数据相关推荐
- geojson全国各省市区地图json数据绘制Echarts区域地图
全国json数据获取地址: https://github.com/lyhmyd1211/GeoMapData_CN 单独区域json数据获取地址: http://datav.aliyun.com/to ...
- 世界国家geojson大全,各国地图json数据下载
世界国家geojson大全,各国地图json数据下载 转载于:https://www.cnblogs.com/firstcsharp/p/11309393.html
- Echarts全国各省市区地图JS/geojson/svg/excel数据
上家公司和现东家的项目都有用Echarts做图表,但是Echarts不提供地图数据下载.详见:https://www.echartsjs.com/zh/download-map.html .其实国 ...
- 乡镇级echarts地图json获取、各省市区地图json文件
转载原文地址:https://blog.csdn.net/weixin_44861708/article/details/114223258 省市区地图json 链接:https://pan.baid ...
- geoJson全国各省市地图json数据获取
记录: 地址1:DataV.GeoAtlas地理小工具系列 地址2: POI数据|POI数据库|最新POI数据库|最全POI数据库|百度POI数据库|高德POI数据库|谷歌POI数据库|2022年PO ...
- 获取全国省地市地图json数据
1.http://datav.aliyun.com/tools/atlas/#&lat=22.65267050733856&lng=114.18983459472656&zoo ...
- 如何获取全国各省市区的地理区域位置(地图-JSON-点位-行政区域)
如何获取全国各省市区的JSON文件?在这之前,我们总是为了寻找相关区域的JSON地图文件发愁,看完本文之后,你就再也不会发愁了! 在这里,推荐一个网站 =>阿里云数据可视化平台 通过选择左侧地图 ...
- 2015年全国谷歌卫星地图离线数据存储方案
一.概述 随着地理信息数字化的发展,大数据时代的到来.海量数据的传输和安全性给我们带来巨大的困难.海量数据的传输受到互联网技术和硬件的限制,占用着较多的在线资源和线下存储空间,产生了能源.空间.人力的 ...
- GaoHR | 全国各省30m分辨率DEM数据
GaoHR | 全国各省30m分辨率DEM数据 Earthdata Search
最新文章
- Linux的视频编程(V4L2编程)【转】
- [驱动注册]platform_driver_register()与platform_device_register()
- 《正则表达式经典实例(第2版)》——2.6 匹配完整单词
- java求质数为什么%3ci 2_C语言程序设计部分习题及例题参考程序
- 深度学习(十二)——Winograd(2)
- 脸部细微表情识别_您可以仅使用面部表情来控制字体吗?
- 论文浅尝 - ACL2020 | 用于链接预测的开放知识图谱嵌入
- requestAnimationFrame 方法你真的用对了吗?
- 【多题合集】线段覆盖1、2、3
- javascript 中的prompt 用法
- filter - date 日期插件
- 手机计算机软件删除了怎么恢复,手机卸载的软件怎么恢复?手机卸载的软件恢复方法介绍...
- 推荐一款PDF阅读工具Apabi Reader
- 智能交通系统系统中的车牌识别技术
- 02_LATTICE入门篇之新建项目
- 迪斯科算法_为什么迪斯科极乐世界如此可重播
- 最新、最全开心网钓鱼外挂下载_开心网001钓鱼外挂
- 跳转到新页面并清除当前页面的history记录
- 2022年最新宁夏建筑安全员模拟题库及答案
- 九州云亮相中国国际工业博览会 展出最新边缘计算技术
热门文章
- workman如何实现异步任务
- 单片机学习笔记——data,idata,xdata,pdata,code
- 进制转化器 python3.10
- 工欲善其事,必先利其器之-使用Keynote遥控来代替翻页激光笔
- 腾讯云im:用户端来实现群组消息的功能
- 养宠物还是养主人?大数据告诉你究竟是谁孤独寂寞冷?
- 数据库正在复制无法分离解决办法
- 如何写好计算机类综述怎么查文献(信息检索与利用基础知识总结一)
- 2022年西式面点师(中级)考试练习题及模拟考试
- c语言特征码搜索,[原创]一个速度不是很快但是逻辑很简单的内存特征码搜索