Beispiel #1
0
    def _get_utfgrid_caches(self, *tiles):
        """Get location of geocaches within tiles, using UTFGrid service

        Parameter tiles contains one or more tuples dictionaries that
        are of form (x, y, z).  Return generator object of Cache
        instances."""

        found_caches = set()
        for tile in tiles:
            ug = UTFGrid(self, *tile)
            for c in ug.download():
                # Some geocaches may be found multiple times if they are on the
                # border of the UTFGrid. Throw additional ones away.
                if c.wp in found_caches:
                    logging.debug("Found cache {} again".format(c.wp))
                    continue
                found_caches.add(c.wp)
                yield c
        logging.info("{} tiles downloaded".format(len(tiles)))
Beispiel #2
0
 def setUp(self):
     self.grid = UTFGrid(Geocaching(), 8800, 5574, 14)
     self.grid.size = 64
     self.cb = GridCoordinateBlock(self.grid)
Beispiel #3
0
 def setUp(self):
     self.grid = UTFGrid(Geocaching(), 8800, 5574, 14)