developmentseed / landsat-util

A utility to search, download and process Landsat 8 satellite imagery
Creative Commons Zero v1.0 Universal
688 stars 147 forks source link

Searching for Landsat-8 data #255

Open vka012 opened 5 years ago

vka012 commented 5 years ago

Hi

I am searching for cloud-free Landsat-8 scenes of sea ice in the arctic region. I am running the landsat-util in python. However, I have some questions.

I have read that there at some point was possible to use a shapefile to define the footprint or region of interest when searching. Is this feature removed? And if so, why? As for now, I iterate over the latitudes and longitudes covering my region of interest, but this procedure is quite slow. Is there a better way to do this? Secondly, is it possible to determine the metadata returned for the products found? As for now only the cloud-coverpercentage, date, path, row, sat_type, sceneID, and thumbnail link (which does not work) is returned. I would for instance like to extract the exact time of acquisition, exact footprint, and product id.

Hope to hear from someone, Vebjørn

vka012 commented 5 years ago

I have still not found out how (or if its possible) to use shapefiles for defining the bounding box I wish to search within.

However, I have found a way to extract the desired metadata. The metadata returned is determined in search.py. Just add a few extra lines when shaping the 'result' dict. For instance in line 144:159 of search.py:

            result['status'] = u'SUCCESS'
            result['total'] = r_dict['meta']['found']
            result['limit'] = r_dict['meta']['limit']
            result['total_returned'] = len(r_dict['results'])
            result['results'] = [{'sceneID': i['sceneID'],
                                  'sat_type': u'L8',
                                  'path': three_digit(i['path']),
                                  'row': three_digit(i['row']),
                                  'starttime' : i['sceneStartTime'], #ADDED
                                  'stoptime' : i['sceneStopTime'],  #ADDED
                                  'thumbnail': i['browseURL'],
                                  'date': i['acquisitionDate'],
                                  'cloud': i['cloud_coverage'],
                                  'productid': i['LANDSAT_PRODUCT_ID'],    #ADDED
                                  'footprint': i['data_geometry']['coordinates'][0]} #ADDED
                                 for i in r_dict['results']]

This would cause the result in candidate_scenes to include the productid, footprint, and start- and stoptime of acquisition (if geojson=False when searching).

Best, Vebjørn

matthewhanson commented 5 years ago

Hi @vka012 Sorry for the delay.

landsat-util is on it's way to getting deprecated and we haven't had the time to put resources into new features. It's currently being replaced by our new sat-api and by sat-search. Sat-search allows you to search with a geojson and get the data, but doesn't have the processing capabilities that landsat-util does. We will be creating a new library in the coming months that completely replaces landsat-util with a tool that can be used on both Landsat-8 and Sentinel-2 (or any data source we add to sat-api).

In the meantime you might want to check those libraries out and see if they can help you: https://medium.com/devseed/sat-api-an-api-for-spatiotemporal-asset-catalogs-88c3c78fdb0e https://github.com/sat-utils/sat-search/