sentinelhub.geopedia.request

Data request interface for Geopedia services

class sentinelhub.geopedia.request.GeopediaRequest(layer, service_type, *, bbox, theme=None, image_format=MimeType.PNG, **kwargs)[source]

Bases: DataRequest

The base class for Geopedia requests where all common parameters are defined.

Parameters
  • layer (str) – Geopedia layer which contains requested data

  • service_type (ServiceType) – Type of the service, supported are ServiceType.WMS and ServiceType.IMAGE

  • bbox (BBox) – Bounding box of the requested data

  • theme (Optional[str]) – Geopedia’s theme endpoint string for which the layer is defined. Only required by WMS service.

  • image_format (MimeType) – Format of the returned image by the Sentinel Hub’s WMS getMap service. Default is constants.MimeType.PNG.

  • data_folder – Location of the directory where the fetched data will be saved.

  • config – A custom instance of config class to override parameters from the saved configuration.

  • kwargs (Any) –

abstract create_request()[source]

An abstract method for logic of creating download requests

Return type

None

class sentinelhub.geopedia.request.GeopediaWmsRequest(layer, theme, bbox, *, width=None, height=None, **kwargs)[source]

Bases: GeopediaRequest

Web Map Service request class for Geopedia

Creates an instance of Geopedia’s WMS (Web Map Service) GetMap request, which provides access to WMS layers in Geopedia.

Parameters
  • layer (str) – Geopedia layer which contains requested data

  • theme (str) – Geopedia’s theme endpoint string for which the layer is defined.

  • bbox (BBox) – Bounding box of the requested data

  • width (Optional[int]) – width (number of columns) of the returned image (array)

  • height (Optional[int]) – height (number of rows) of the returned image (array)

  • image_format – Format of the returned image by the Sentinel Hub’s WMS getMap service. Default is constants.MimeType.PNG.

  • data_folder – Location of the directory where the fetched data will be saved.

  • config – A custom instance of config class to override parameters from the saved configuration.

  • kwargs (Any) –

create_request()[source]

Set download requests

Create a list of DownloadRequests for all Sentinel-2 acquisitions within request’s time interval and acceptable cloud coverage.

Return type

None

class sentinelhub.geopedia.request.GeopediaImageRequest(*, image_field_name, keep_image_names=True, gpd_session=None, **kwargs)[source]

Bases: GeopediaRequest

Request to access data in a Geopedia vector / raster layer.

Parameters
  • image_field_name (str) – Name of the field in the data table which holds images

  • keep_image_names (bool) – If True images will be saved with the same names as in Geopedia otherwise Geopedia hashes will be used as names. If there are multiple images with the same names in the Geopedia layer this parameter should be set to False to prevent images being overwritten.

  • layer – Geopedia layer which contains requested data

  • bbox – Bounding box of the requested data

  • image_format – Format of the returned image by the Sentinel Hub’s WMS getMap service. Default is constants.MimeType.PNG.

  • gpd_session (Optional[GeopediaSession]) – Optional parameter for specifying a custom Geopedia session, which can also contain login credentials. This can be used for accessing private Geopedia layers. By default, it is set to None and a basic Geopedia session without credentials will be created.

  • data_folder – Location of the directory where the fetched data will be saved.

  • config – A custom instance of config class to override parameters from the saved configuration.

  • kwargs (Any) –

create_request(reset_gpd_iterator=False)[source]

Set a list of download requests

Set a list of DownloadRequests for all images that are under the given property of the Geopedia’s Vector layer.

Parameters

reset_gpd_iterator (bool) – When re-running the method this flag is used to reset/keep existing gpd_iterator (i.e. instance of GeopediaFeatureIterator class). If the iterator is not reset you don’t have to repeat a service call but tiles and dates will stay the same.

Return type

None

get_items()[source]

Returns iterator over info about data used for this request

Returns

Iterator of dictionaries containing info about data used in this request.

Return type

Optional[GeopediaFeatureIterator]