示例#1
0
 def points():
     """Yield x,y pixel coords within this tile, top-left of dot.
     """
     result = []
     for point in _points:
         x, y = gmerc.ll2px(point.latitude, point.longitude, self.zoom)
         x = x - self.x1  # account for tile offset relative to
         y = y - self.y1  #  overall map
         point_density = point.density
         while point_density > 0:
             result.append((x - self.pad, y - self.pad))
             point_density = point_density - 1
     return result
示例#2
0
 def points():
     """Yield x,y pixel coords within this tile, top-left of dot.
     """
     result = []
     for feature_dict in _points:
         point = feature_dict[self.point_field]
         x, y = gmerc.ll2px(point.y, point.x, self.zoom)
         x = x - self.x1  # account for tile offset relative to
         y = y - self.y1  #  overall map
         point_density = feature_dict.get(self.density_field, 1)
         for i in range(point_density):
             result.append((x - self.pad, y - self.pad))
     return result
示例#3
0
 def points(self):
     fields = [self.point_field]
     if self.density_field:
         fields.append(self.density_field)
     _points = self.features_inside().values(*fields)
     
     result = []
     for feature_dict in _points:
         point = feature_dict[self.point_field]
         x, y = gmerc.ll2px(point.y, point.x, self.zoom)
         x = x - self.x1 # account for tile offset relative to
         y = y - self.y1 #  overall map
         point_density = feature_dict.get(self.density_field, 1)
         result.append((x,  y, point_density))
     return result