pysal.explore.spaghetti.Network.simulate_observations

Network.simulate_observations(count, distribution='uniform')[源代码]

在网络上生成模拟点模式。

参数:
计数 : 利息

要创建的点数或分布的平均值(如果不是“统一的”)。

distribution : STR

'均匀','泊松'随机点分布。如果是泊松,如果是分布,泊松是从网络总长度的一半计算出来的。

返回:
random_pts : 双关语

关键是边缘元组。值是新点坐标的列表。

实例

>>> import pysal.explore.spaghetti as spgh
>>> ntw = spgh.Network(examples.get_path('streets.shp'))
>>> ntw.snapobservations(examples.get_path('crimes.shp'),
...                                        'crimes',
...                                         attribute=True)
>>> npts = ntw.pointpatterns['crimes'].npoints
>>> sim = ntw.simulate_observations(npts)
>>> isinstance(sim, spgh.network.SimulatedPointPattern)
True