Example #1
0
 def getObjectInBounds(self, latlng):
     """
     TODO: Improve the efficienty of this function
     Get the object within the latlng bounds of {latlng}
     """
     
     # Get a bounding box for a geosearch.
     b = Bounds.createBoundsFromAMFData(latlng)
     box = b.asBox()
     
     # The list of road
     listOfObjects = []
     for obj in [Road, Portal, Tower]:
         
         # Get all of the objects with the bounds
         o = obj.bounding_box_fetch(obj.all(), box, max_results = 1000)
         listOfObjects.extend(o)
     logging.error(str(listOfObjects))
     return ArrayCollection(listOfObjects)