Search for collections#
pygeodes let’s you search for collections, provided you have a configured pygeodes.geodes.Geodes
object (see Creating your Geodes object).
First query#
Then you can start making some queries, let’s start by retrieving all collections who are related to the term grd :
collections,dataframe = geodes.search_collections("grd")
But you can also provide a query in JSON format :
query = {'id' : {'contains' : 'PEPS'}}
collections,dataframe = geodes.search_collections(query=query)
See also
For more complex queries, see Building queries.
Configuration#
By default, it returns a collections
object, which is a list of pygeodes.utils.stac.Collection
, and a dataframe
object, which is a geopandas.GeoDataframe
object (please refer to geopandas docs).
See also
For further formatting configuration, see Manipulating objects.
If you wish to get only the collections, you can use the parameter return_df=False
.
collections = geodes.search_collections(query=query,return_df=False)
By default, it returns all the objects corresponding to your query, so it can be long (making many API calls) if your query is not really precise. You could just want a little overview of the objects, you can set the parameter get_all=False
, to get just the first items returned (by making just one API call).
collections = geodes.search_collections(query=query,return_df=False,get_all=False)
See also
You can refer to the implementation of search_collections
for further details (Geodes.search_collections()
)