全部版块 我的主页
论坛 经济学论坛 三区 区域经济学
37286 32
2020-03-23

可达性—加权平均旅行时间的计算

可达性是指依靠交通设施在适当时间到达指定地点的便捷程度。它的高低取决于人的移动能力和由于移动而到达目的地的机会。而人的移动能力和到达目的地的移动机会排除自身因素外,主要取决于采用的交通方式、交通网的完善程度以及道路的通行质量等方面。(相关数据,后台回复20200315获取)

对于可达性的评价指标较为常用的是加权平均旅行时间和经济潜力。加权平均旅行时间主要是物理意义上的可达性,即某节点到达经济中心花费的时间;经济潜力则侧重经济意义上的可达性,表达的是经济中心与其他节点之间由于相互吸引力而产生的作用程度,其综合考虑了节点的经济实力、开发潜力、交通状况等因素。加权平均旅行时间和经济潜力都能够有效的测度某区域的可达性,但这两个指标侧重点不同。前者侧重时间,后者将节点间由于距离衰减而产生的相互作用也纳入考虑范围

加权平均旅行时间
Li=j=1n(Tij×Mj)j=1nMj \text{L}_{\text{i}}=\frac{\sum_{\text{j}=1}^{\text{n}}{\left( \text{T}_{\text{ij}}\times \text{M}_{\text{j}} \right)}}{\sum_{\text{j}=1}^{\text{n}}{\text{M}_{\text{j}}}}
LiLi 表示区域节点i可达性;
nn 表示评价系统内除i地外的节点总数;
TijT_{ij} 表示通过某交通设施和网络从节点i到达经济中心(或活动目的地)所花费的最短时间;
MjM_{j} 表示评价系统范围内某经济中心和活动目的地的某种社会经济要素的流量,即表示该经济中心的经济实力或对周边活动地区的辐射力或者吸引力,可采用GDP总值,人口总量等指标。

经济潜力
Pi=j=1nMjTijα  \text{P}_{\text{i}}=\sum_{\text{j}=1}^{\text{n}}{\frac{\text{M}_{\text{j}}}{\text{T}_{\text{ij}}^{\text{α }}}}
PiP_{i} 表示节点 ii 的经济潜力;
TijT_{ij}MjM_{j} 表示意义同上式;
αα 表示节点 iijj 之间距离摩擦系数,通常取 1。

对于这两个指标,关键难点在于最短时间 TijT_{ij} 的计算。为此,我们想你介绍stata的cntraveltime程序包。它可以基于百度地图API提取两个地点之间旅行所需的时间,此外还可以提取两坐标点之间详细的路径信息。语法格式与参数说明如下:

Syntax

        cntraveltime, baidukey(string) {startlat(varname) startlng(varname) endlat(varname) endlng(varname)} [options]

     +----------------+
    ----+ Search options +-------------------------------------------------------------------------------------------------------------------

    instruction: If users need detail information about the route chosen, option instruction helps. The default is not to show this information.

    transport(string) can change the travel mode. Based on the assumptions of this choice, BaiduMap will calculate the distance and duration between the specified place.  When the option transport is empty, the default is "bus". There are three specific options of transport that "car", "bus" and "bike". other input will give an error.

    intercity(numlist) can choose the detail preference when the given locations in different cities. This option can only be used when specify "bus" in transport(string).  you can enter two numbers in the option, like intercity(1 2), where the first number represents the priority requirement and the second number specifies the mode of transportation.  If the option is empty, both two numbers are 0.  The first number represents the priority requirement where 0 is "as quickly as possible", 1 is "Start as early as possible" and 2 is "as cheap as possible". The second number specifies the mode of transportation where 0 is "train", 1 is "plane" and 2 is "bus"

    tactic(real) can choose the detail preference when the given locations in same cities. Please note that if the transport content is different, the effective range and meaning of the tactic are also different.  Enter the number in the option and the preferences
        represented by different numbers are as follows.
        bus 0: default, recommendation
        bus 1: Less transfer
        bus 2: less walk
        bus 3: no subway
        bus 4: as quickly as possible
        bus 5: subway
        car 0: default
        car 3: avoid high speed
        car 4: high speed priority
        car 5: avoid congested sections
        car 6: avoiding toll stations
        car 7: both 4 and 5
        car 8: both 3 and 4
        car 9: both 4 and 6
        car 10: both 6 and 8
        car 11: both 3 and 6
        bike 0: default, common
        bike 1: electric bicycle

必要参数

baidukey(string)startlat(varname)startlng(varname)endlat(varname)endlng(varname)分别表达百度地图密钥(上期已经提到)、起始点纬度坐标、起始点经度坐标、终点纬度坐标、终点经度坐标。

可选参数:

  • instruction用于提供详细路径信息;
  • transport(string)用于指定旅行方式,用三个选项 car、 bus、 bike,默认为 bus;
  • intercity(numlist)指定当两点位于不同城市时的路径偏好,该选项只有在transport(string)设置为 bus 时才能使用。该选项可以填入两个参数:第一个参数指定优先需求,可填 0(尽可能快) 或 1(尽可能早) 或 2(尽可能便宜);第二个参数可填 0(火车)或 1(飞机)或 2(公交)。
  • tactic(real)指定同城地点间的路线偏好,具体设置语法格式与参数说明已经给出。

这里我们用到的是285个地级市的经纬度数据,计算其他284个地级市到北京市的最短旅行时间与距离:

cd "E:/微信/20200315 可达性"
* 导入数据
import excel "E:\微信\20200315 可达性\数据.xlsx", sheet("Sheet1") firstrow
save data.dta, replace

* 提取北京坐标为向量
gen startlat = lat[1]
gen startlng = lon[1]

keep city id code lat lon startlat startlng
cntraveltime, baidukey(zbLsuDDL4CS2U0M4KezOZZbGUY9iWtVf) startlat(startlat) startlng(startlng) endlat(lat) endlng(lon) intercity(0 0) tactic(2)

    please check the information of location in 59
    please check the information of location in 133
    please check the information of location in 164
    please check the information of location in 166
    please check the information of location in 168
    please check the information of location in 169
    please check the information of location in 171
    please check the information of location in 172
    please check the information of location in 174
    please check the information of location in 227
    please check the information of location in 228
    please check the information of location in 254
    please check the information of location in 285

这里一些地区的计算结果出现问题,一方面可能是因为所用的经纬度为所在地区质心点的坐标,某些地区的质心位置可能很奇怪,无法计算。这种情况下换成行政或者经济中心的坐标数据可以在很大程度上得到解决;两一方面,可能是地区本身的特殊性导致的,

下面列示前10条结果:

list startlat startlng lat lon distance duration in 1/10

     +--------------------------------------------------------------------+
     | startlat    startlng         lat         lon   distance   duration |
     |--------------------------------------------------------------------|
  1. |  40.2182   116.43689     40.2182   116.43689          .          . |
  2. |  40.2182   116.43689   39.352911   117.35321      86001      20268 |
  3. |  40.2182   116.43689   38.114918   114.46721      60888      16802 |
  4. |  40.2182   116.43689   39.706129   118.36456      92562      21401 |
  5. |  40.2182   116.43689   40.051379   119.19456      98919      28475 |
     |--------------------------------------------------------------------|
  6. |  40.2182   116.43689   36.542102   114.50445      64580      20707 |
  7. |  40.2182   116.43689   37.245721   114.80611      77277      21829 |
  8. |  40.2182   116.43689   39.056857   115.10691     277476      27296 |
  9. |  40.2182   116.43689   40.858124   115.08483      80482      21700 |
 10. |  40.2182   116.43689   41.374961   117.55965      37607      29898 |
     +--------------------------------------------------------------------+


往期回顾

  1. stata计算shp文件中的最近距离
  2. 使用stata的twoway系列命令绘制地图
  3. 如何使用R、matlab、arcgis进行趋势面分析
  4. 使用R进行空间自相关检验
  5. 空间权重矩阵的那些事(八)-球面距离权重矩阵
  6. R中空间权重矩阵的处理
  7. 使用R进行地图可视化
  8. 使用QGIS进行地图可视化
  9. 南海九段线可以这样处理
  10. Stata 绘图也可以很好看

参考文献

  1. 罗鹏飞,徐逸伦,张楠楠.高速铁路对区域可达性的影响研究——以沪宁地区为例[J].经济地理,2004,24(3):407~411.
  2. 田沁雪,刘洁.基于可达性的银西和大西高铁对区域影响的差异分析[J].内蒙古科技与经济,2019(22):24-27.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2020-5-9 22:34:56
您好  想请教一下  上面结果算出的distance是什么   谢谢您
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-6-29 15:40:20
小啾啾112 发表于 2020-5-9 22:34
您好  想请教一下  上面结果算出的distance是什么   谢谢您
路线距离
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-7-4 15:12:38
咳咳唐 发表于 2020-6-29 15:40
路线距离
谢谢您
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-10-2 16:52:58
20200315
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-12-12 19:39:38
20200315
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群