def in_rect(self,rect): x0,y0,x1,y1 = rect ix0 = self._index(x0) iy0 = self._index(y0) ix1 = self._index(x1) iy1 = self._index(y1) results = [] for ix in range(ix0,ix1+1): for iy in range (iy0,iy1+1): if self.bins.has_key((ix,iy)): for point,value in self.bins[(ix,iy)]: if geo.point_in_rect_q(point, rect): results.append((point,value)) return results
def _parse_node(self, osmId, coords, tags=None): if self.proj: coords = self.proj.project_point(coords) if self.clip_rect and not geo.point_in_rect_q(coords,self.clip_rect): return self.nodes[osmId] = Node(coords, tags=tags)