Example #1
0
 def get_adjacent_buildings(self, node, threshold):
     """ Finds the buildngs that are within a search area around a given L{geo.osm_import.Node} object
     
     @type node: L{geo.osm_import.Node}
     @param node: OSM Node object
     @param threshold: search distance in meters
     @returns: a list of the found buildings
     @rtype: C{list} of L{geo.osm_import.Way}
     """
     box = create_node_box(node, threshold)
     buildings = [self.__osm_object.getWayByID(index) for index in self.__osm_object.building_tree.intersection(box, "raw")]
     return buildings
Example #2
0
 def get_adjacent_streets(self, node, threshold):
     """ Returns a list of street objects within the threshold distance to the given node.
     
     A rectangular box with the node as the center is created. The threshold in meters is the distance from the center to the top/left/bottom/right. All street object that lie within this box are returned.
     
     @type node: L{Node}
     @param node: OSM Node object
     @type threshold: C{int}
     @param threshold: distatance in meters
     @returns: a list of street objects
     @rtype: C{list} of L{Way}
     
     """
     box = create_node_box(node, threshold)
     streets = [self.getWayByID(index) for index in self.street_tree.intersection(box, "raw")]
     return streets