def items(self, limit=10000):
        """ Return all of the Items and Collections for this search """
        _limit = 500
        if 'ids' in self.kwargs:
            col = self.kwargs.get('query', {}).get('collection', {}).get('eq', None)
            if col is None:
                raise SatSearchError('Collection required when searching by id')
            return self.items_by_id(self.kwargs['ids'], col)

        items = []
        found = self.found()
        if found > limit:
            logger.warning('There are more items found (%s) than the limit (%s) provided.' % (found, limit))
        maxitems = min(found, limit)
        kwargs = {
            'page': 1,
            'limit': min(_limit, maxitems)
        }
        kwargs.update(self.kwargs)
        while len(items) < maxitems:
            items += [Item(i) for i in self.query(**kwargs)['features']]
            kwargs['page'] += 1

        # retrieve collections
        collections = []
        for c in set([item.properties['collection'] for item in items if 'collection' in item.properties]):
            collections.append(self.collection(c))
            #del collections[c]['links']

        # merge collections into items
        #_items = []
        #for item in items:
        #    import pdb; pdb.set_trace()
        #    if 'collection' in item['properties']:
        #        item = dict_merge(item, collections[item['properties']['collection']])
        #    _items.append(Item(item))

        return Items(items, collections=collections, search=self.kwargs)
def items ( self , limit = 10000 ) : _limit = 500 if 'ids' in self . kwargs : col = self . kwargs . get ( 'query' , { } ) . get ( 'collection' , { } ) . get ( 'eq' , None ) if col is None : raise SatSearchError ( 'Collection required when searching by id' ) return self . items_by_id ( self . kwargs [ 'ids' ] , col ) items = [ ] found = self . found ( ) if found > limit : logger . warning ( 'There are more items found (%s) than the limit (%s) provided.' % ( found , limit ) ) maxitems = min ( found , limit ) kwargs = { 'page' : 1 , 'limit' : min ( _limit , maxitems ) } kwargs . update ( self . kwargs ) while len ( items ) < maxitems : items += [ Item ( i ) for i in self . query ( ** kwargs ) [ 'features' ] ] kwargs [ 'page' ] += 1 collections = [ ] for c in set ( [ item . properties [ 'collection' ] for item in items if 'collection' in item . properties ] ) : collections . append ( self . collection ( c ) ) return Items ( items , collections = collections , search = self . kwargs )
Return all of the Items and Collections for this search