def get_tolerance(zoom_level):
# pixels squared factor
tolerance_square_pixels = 7
# default Google/Bing map tile scales
metres_per_pixel = 156543.03390625 / math.pow(2.0, float(zoom_level + 1))
# the tolerance (metres) for vector simplification using the VW algorithm
square_metres_per_pixel = math.pow(metres_per_pixel, 2.0)
# tolerance to use
tolerance = square_metres_per_pixel * tolerance_square_pixels
return tolerance
# maximum number of decimal places for boundary coordinates - improves display performance
评论列表
文章目录