ni1o1 / transbigdata

A Python package develop for transportation spatio-temporal big data processing, analysis and visualization.
https://transbigdata.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
455 stars 115 forks source link

bounds 该如何选取 #69

Closed ybxgood closed 1 year ago

ybxgood commented 1 year ago

请问,对于一个数据,bounds 值如何选取

ni1o1 commented 1 year ago

根据研究的城市地理范围确定

bounds=[左下经度,左下纬度,右上经度,右上纬度]

如果你有研究区域的shp或geojson文件,也可以用下面代码直接计算

#读取研究范围
area = gpd.read_file('Data/研究区域.shp')
#获取研究区域的bounds
bounds = area.unary_union.bounds
yinglu123456 commented 1 year ago

你好,我想跟进一下这个问题,如果bounds设置为在南半球的话,比如bounds = [153.0084,-27.4875,153.0516, -27.5219] ,使用 tbd.plot_map( ) 会报错:ValueError: Width and height must be >= 0

ni1o1 commented 1 year ago

你好,我想跟进一下这个问题,如果bounds设置为在南半球的话,比如bounds = [153.0084,-27.4875,153.0516, -27.5219] ,使用 tbd.plot_map( ) 会报错:ValueError: Width and height must be >= 0

bounds = [153.0084,-27.4875,153.0516, -27.5219] 应改为[153.0084, -27.5219,153.0516,-27.4875]

import transbigdata as tbd
import matplotlib.pyplot as plt
# bounds = [lon1,lat1,lon2,lat2],其中lon1<lon2,lat1<lat2
bounds = [153.0084, -27.5219,153.0516,-27.4875]
tbd.plot_map(plt,bounds)
plt.show()
yinglu123456 commented 1 year ago

谢谢!