地理信息分析_不同城市

关注你去过的城市

 城市如何及为什么成为目前的样子,
  重点观察有机模式、网络、图形式城市、壮丽风格以及城市天际线等一些主题,从中解释城市模式蕴藏的秩序

隐藏在地名下的不同城市

 Hidden Patterns in Street Names: a Data Science Story
 the country’s social, political and lived contexts
 street names and their patterns.
###evidence概念:
《地名管理条例》《地名管理条例实施细则》
 《关于开展第二次全国地名普查的通知》
《关于进一步整理不规范地名的通知》 
“大、洋、怪、重”等违反地名命名技术规范的地名
命名机构 “地名委员会”或者“地名办公室”的机构
 里,居也,从田从土。说明“里”有以前居住单位的意思
01.时代特色的: 胜利 建设 和平
     “工业路”排名首位,另外还有文化路、人民路、和平路、光明路、复兴路、朝阳路、胜利路、自强路 
02.美好愿望,比如说永兴街(希望街道永远兴旺)
03.跟“水”有关的有:海、湖、江、河、涌、滘、潮、湾、港、溪、滨、洲、浦、洋、潭、沟、池等,
04.跟“山、地”等有关的有:岭、峰、山、田、泉、坪、埔、堤、坑、坝、屯。
05.植物:包含“林、梅、竹、杨、柳、莲、桃、李、杏、棉”等字的路名。
06.儒释道特色的路名

 政治-经济-文化-宗教-历史-生态
 承载着历史传统和人文情怀,也同建设规划、测绘地理信息、公共安全和国家安全等现代化建设方面 

数据源:

Open Street Map data
	结构化 
road network
    the roads and streets of the country are named 
	 road type : 道路类型 公路按公路行政等级分为国道,省道,县道,乡道,村道和专用公路六个等级
	 Street Types:街区类型 residential  Living 
	 Neighborhoods :社区
area
    Bus 
    subway 
	台、站、港、场 城镇街道的名称、楼宇的名称

   osm_id  code   fclass name    geometry
  有一个geometry列,用来保存几何信息(或GeoJSON要素)

osm_id  code   fclass   name  geometry
geometry:空间数据(面积、距离、缓冲区、交叉点......)
    MULTIPOLYGON  POLYGON  LINESTRING  POINT
fclass:道路等级;
name:道路名称:
ref:道路编号;oneway:单双线通行情况;
maxspeed:最高通行速度;bridge:桥梁,T是桥梁,F不是桥梁;
tunnel:隧道,T是隧道,F不是隧道。

工具

  •fiona[1]:基于ogr的封装,提供了更简洁的API
  •pyshp[2]:纯python实现的shape文件处理库,支持shp,shx和dbf文件的读写•ogr :gdal中的用于处理边界文件的模块•
  geopandas[3]:基于 fiona 进行了封装	 也有两种数据类型:
      GeoSeries
      GeoDataFrame
 而geopandas作为Python生态中优秀的空间数据分析处理工具
   PostGIS作为postgresql针对地理空间数据的拓展功能,可以帮助我们有效管理和固化空间矢量数据,以及开展空间数据分析,

geopandas安装

 需要先安装其依赖包:gdal、Shapely、Fiona、pyproj
 pip install numpy  -i https://mirrors.aliyun.com/pypi/simple
 pip install pandas  -i https://mirrors.aliyun.com/pypi/simple
 pip install shapely  -i https://mirrors.aliyun.com/pypi/simple
 
 pip install wheel  -i https://mirrors.aliyun.com/pypi/simple
 pip install pipwin -i https://mirrors.aliyun.com/pypi/simple 
 pipwin install gdal
 pip install geopandas  -i https://mirrors.aliyun.com/pypi/simple

bbox过滤允许我们在 read_file() 中传入一个边界框作为参数 bbox ,
bbox=(118, 31, 119, 32)  
格式为 (左下角x, 左下角 y, 右上角x, 右上角y)  
mask=geometry.Polygon([(100, 20), (110, 30), (120, 20)]))  

使用示例

 pandas, seaborn and a mapping library called contextily for prettier maps	
 hand-label about half of the dataframe’s rows

 import pandas as pd
 import geopandas
 import matplotlib.pyplot as plt
  
 #显示所有列
 pd.set_option('display.max_columns', None)
 #显示所有行
 pd.set_option('display.max_rows', None)
 
 #world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
 # C:\Users\tt\Desktop\data_road
 file_path =  r"C:\Users\tt\Downloads\china-latest-free.shp\gis_osm_railways_free_1.shx"
 print(file_path)
 road = geopandas.read_file(file_path,bbox=(117, 31, 120, 32) )
 print(type(road),road.head(),road.tail(),road.sample() )
 print(road["name"].drop_duplicates() )	

参考

  https://anvaka.github.io/city-roads/	
  https://blog.csdn.net/qq_38017966/article/details/123160325
  从高德地图获取该城市的行政区域边界经纬度
  https://www.openstreetmap.org/
  邮编网获取该城市各区县的街道名或地址
  开放式街道地图(OpenStreetMap)  https://github.com/openstreetmap/
  https://www.xihe-energy.com/
   全国地理信息资源目录服务系统 https://www.webmap.cn/main.do?method=index
  https://www.casdc.cn/ 
  OpenStreetMap网址提供的第三方网站下载Osm的一种方法。OSM数据在国家边界数据方面非常不准确-不用其数据
  OpenStreetMap官网:https://www.openstreetmap.org
  Geofabrik Downloads官网:https://download.geofabrik.de/
posted @ 2023-03-08 16:45  辰令  阅读(147)  评论(0)    收藏  举报