SearchResult#

The SearchResult class provides a convenient way to handle and manipulate search results obtained from the EODAG API. It offers various methods to filter, transform, and interact with the search results, making it easier to work with geospatial data in different formats.

Constructor#

SearchResult(products[, number_matched, errors])

An object representing a collection of EOProduct resulting from a search.

Crunch#

SearchResult.crunch(cruncher, **search_params)

Do some crunching with the underlying EO products.

SearchResult.filter_date([start, end])

Apply FilterDate crunch, check its documentation to know more.

SearchResult.filter_latest_intersect(geometry)

Apply FilterLatestIntersect crunch, check its documentation to know more.

SearchResult.filter_latest_by_name(name_pattern)

Apply FilterLatestByName crunch, check its documentation to know more.

SearchResult.filter_overlap(geometry[, ...])

Apply FilterOverlap crunch, check its documentation to know more.

SearchResult.filter_property([operator])

Apply FilterProperty crunch, check its documentation to know more.

SearchResult.filter_online()

Use cruncher FilterProperty, filter for online products.

Conversion#

SearchResult.from_geojson(feature_collection)

Builds an SearchResult object from its representation as geojson

SearchResult.as_geojson_object()

GeoJSON representation of SearchResult

SearchResult.as_shapely_geometry_object()

shapely.GeometryCollection representation of SearchResult

SearchResult.as_wkt_object()

WKT representation of SearchResult

Interface#

SearchResult.__geo_interface__

Implements the geo-interface protocol.

class eodag.api.search_result.SearchResult(products, number_matched=None, errors=None)[source]#

An object representing a collection of EOProduct resulting from a search.

Parameters:
  • products (list[EOProduct]) – A list of products resulting from a search

  • number_matched (int | None, default: None) – (optional) the estimated total number of matching results

  • errors (list[tuple[str, Exception]] | None, default: None)

Variables:
  • data – List of products

  • number_matched – Estimated total number of matching results

property __geo_interface__: dict[str, Any]#

Implements the geo-interface protocol.

See https://gist.github.com/sgillies/2217756

as_geojson_object()[source]#

GeoJSON representation of SearchResult

Return type:

dict[str, Any]

as_shapely_geometry_object()[source]#

shapely.GeometryCollection representation of SearchResult

Return type:

GeometryCollection

as_wkt_object()[source]#

WKT representation of SearchResult

Return type:

str

crunch(cruncher, **search_params)[source]#

Do some crunching with the underlying EO products.

Parameters:
  • cruncher (Crunch) – The plugin instance to use to work on the products

  • search_params (Any) – The criteria that have been used to produce this result

Return type:

SearchResult

Returns:

The result of the application of the crunching method to the EO products

filter_date(start=None, end=None)[source]#

Apply FilterDate crunch, check its documentation to know more.

Parameters:
Return type:

SearchResult

filter_latest_by_name(name_pattern)[source]#

Apply FilterLatestByName crunch, check its documentation to know more.

Parameters:

name_pattern (str)

Return type:

SearchResult

filter_latest_intersect(geometry)[source]#

Apply FilterLatestIntersect crunch, check its documentation to know more.

Parameters:

geometry (dict[str, Any] | BaseGeometry | Any)

Return type:

SearchResult

filter_online()[source]#

Use cruncher FilterProperty, filter for online products.

Return type:

SearchResult

filter_overlap(geometry, minimum_overlap=0, contains=False, intersects=False, within=False)[source]#

Apply FilterOverlap crunch, check its documentation to know more.

Parameters:
  • geometry (Any)

  • minimum_overlap (int, default: 0)

  • contains (bool, default: False)

  • intersects (bool, default: False)

  • within (bool, default: False)

Return type:

SearchResult

filter_property(operator='eq', **search_property)[source]#

Apply FilterProperty crunch, check its documentation to know more.

Parameters:
  • operator (str, default: 'eq')

  • search_property (Any)

Return type:

SearchResult

static from_geojson(feature_collection)[source]#

Builds an SearchResult object from its representation as geojson

Parameters:

feature_collection (dict[str, Any]) – A collection representing a search result.

Return type:

SearchResult

Returns:

An eodag representation of a search result