本文整理汇总了Python中layer.Layer.Y[i]方法的典型用法代码示例。如果您正苦于以下问题:Python Layer.Y[i]方法的具体用法?Python Layer.Y[i]怎么用?Python Layer.Y[i]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类layer.Layer
的用法示例。
在下文中一共展示了Layer.Y[i]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rimap
# 需要导入模块: from layer import Layer [as 别名]
# 或者: from layer.Layer import Y[i] [as 别名]
def rimap(n, N = 30, alpha = [0.01,0.3], sigma = [1.1,1.4], dt = 0.1,
pg = 0.01, pu = 0.05, su = 0.315, boundary = ""):
"""Creates an irregular maps
:param n: number of areas
:type n: integer
:param N: number of points sampled from each irregular polygon (MR-Polygon)
:type N: integer
:param alpha: min and max value to sampled alpha; default is (0.1,0.5)
:type alpha: List
:param sigma: min and max value to sampled sigma; default is (1.2,1.5)
:type sigma: List
:param dt: time delta to be used to create irregular polygons (MR-Polygons)
:type dt: Float
:param pg: parameter to define the scaling factor of each polygon before being introduced as part of the irregular map
:type pg: Float
:param pu: parameter to define the probability of increase the number of areas of each polygon before being introduced into the irregular map
:type pu: Float
:param su: parameter to define how much is increased the number of areas of each polygon before being introduced into the irregular map
:type su: Float
:param boundary: Initial irregular boundary to be used into the recursive irregular map algorithm
:type boundary: Layer
:rtype: Layer
:return: RI-Map instance
**Examples** ::
import clusterpy
lay = clusterpy.rimap(1000)
lay.exportArcData("rimap_1000")
"""
rm = rim(n, N, alpha, sigma, dt, pg, pu, su, boundary)
areas = rm.carteAreas
areas = fixIntersections(areas)
Wqueen,Wrook, = weightsFromAreas(areas)
layer = Layer()
layer.areas = areas
layer.Wqueen = Wqueen
layer.Wrook = Wrook
layer.shpType = 'polygon'
layer.name = "rimap_" + str(len(areas))
layer.fieldNames = ["Id","nw"]
layer.Y = {}
for i in Wrook:
layer.Y[i] = [i,len(Wrook[i])]
return layer