本文整理汇总了Python中Polygon.setTolerance方法的典型用法代码示例。如果您正苦于以下问题:Python Polygon.setTolerance方法的具体用法?Python Polygon.setTolerance怎么用?Python Polygon.setTolerance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygon
的用法示例。
在下文中一共展示了Polygon.setTolerance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: line2pointIntersection
# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setTolerance [as 别名]
from mrpolygons import mrpolygon, scalePolygon, polarPolygon2cartesian, transportPolygonGeometry, transportPolygon
import Polygon
Polygon.setTolerance(1e-3)
from Polygon import Polygon
from Polygon.Utils import fillHoles, prunePoints, reducePoints
import numpy
import os
import sys
import imp
from contiguity import weightsFromAreas
def line2pointIntersection(line,point,tol):
if line.distance(point) < tol:
return point
else:
return None
def line2mpointsIntersection(line,mpoints,tol):
result = []
for point in mpoints:
if line2pointIntersection(line,point,tol) != None:
result.append(point)
if len(result) >= 2:
intersection = result.sort(key=lambda x: Point(line.coords[0]).distance(Point(x)))
return result
class rimap():
def __init__(self,n=3600,N=30,alpha=[0.1,0.5],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
示例2: __init__
# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setTolerance [as 别名]
#!/usr/bin/env python
import math,re, os, random
import Polygon, Polygon.IO, Polygon.Utils
import project
from regions import *
import itertools
import decomposition
Polygon.setTolerance(0.1)
class parseLP:
"""
A parser to parse the locative prepositions in specification
"""
def __init__(self):
pass
def main(self,argv):
""" Main function; run automatically when called from command-line """
spec_file = argv
self.regionNear = []
self.regionBetween = []
defaultNearDistance = 50
# load data
self.proj = project.Project()
self.proj.setSilent(True)
self.proj.loadProject(spec_file)
示例3: __init__
# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setTolerance [as 别名]
def __init__(self, poly=None, color=(1,1,1,0.9), keepsimple = False, minlinelen=2):
self.color = color
self.poly = poly
self.keepsimple = keepsimple
po.setTolerance(0.1)
self.minlinelen = minlinelen