constants

Module defining constants and enumerate types used in the package

class sentinelhub.constants.PackageProps[source]

Bases: object

Class for obtaining package properties. Currently it supports obtaining package version.

static get_version()[source]

Returns package version

Returns:package version
Return type:str
class sentinelhub.constants.ServiceType[source]

Bases: enum.Enum

Enum constant class for type of service

Supported types are WMS, WCS, WFS, AWS, IMAGE

class sentinelhub.constants.DataSource[source]

Bases: enum.Enum

Enum constant class for types of satellite data

Supported types are SENTINEL2_L1C, SENTINEL2_L2A, LANDSAT8, SENTINEL1_IW, SENTINEL1_EW, SENTINEL1_EW_SH, SENTINEL1_IW_ASC, SENTINEL1_EW_ASC, SENTINEL1_EW_SH_ASC, SENTINEL1_IW_DES, SENTINEL1_EW_DES, SENTINEL1_EW_SH_DES, DEM, MODIS, LANDSAT5, LANDSAT7, SENTINEL3, SENTINEL5P, ENVISAT_MERIS, SENTINEL2_L3B, LANDSAT8_L2A

is_sentinel1()[source]

Checks if source is Sentinel-1

Example: DataSource.SENTINEL1_IW.is_sentinel1() or DataSource.is_sentinel1(DataSource.SENTINEL1_IW)

Parameters:self (DataSource) – One of the supported data sources
Returns:True if source is Sentinel-1 and False otherwise
Return type:bool
contains_orbit_direction(orbit_direction)[source]

Checks if data source contains given orbit direction. Note: Data sources with “both” orbit directions contain ascending and descending orbit directions.

Parameters:
  • self (DataSource) – One of the supported data sources
  • orbit_direction (string) – One of the orbit directions
Returns:

True if data source contains the orbit direction

Returns:

bool

is_timeless()[source]

Checks if data source is time independent

Example: DataSource.DEM.is_timeless() or DataSource.is_timeless(DataSource.DEM)

Parameters:self (DataSource) – One of the supported data sources
Returns:True if data source is time independent and False otherwise
Return type:bool
is_uswest_source()[source]

Checks if data source via Sentinel Hub services is available at US West server

Example: DataSource.LANDSAT8.is_uswest_source() or DataSource.is_uswest_source(DataSource.LANDSAT8)

Parameters:self (DataSource) – One of the supported data sources
Returns:True if data source exists at US West server and False otherwise
Return type:bool
class sentinelhub.constants.CRSMeta[source]

Bases: enum.EnumMeta

Metaclass used for building CRS Enum class

This is executed at the beginning of runtime when CRS class is created

class sentinelhub.constants.CRS[source]

Bases: enum.Enum

Coordinate Reference System enumerate class

Available CRS constants are WGS84, POP_WEB (i.e. Popular Web Mercator) and constants in form UTM_<zone><direction>, where zone is an integer from [1, 60] and direction is either N or S (i.e. northern or southern hemisphere)

epsg

EPSG code property

Returns:EPSG code of given CRS
Return type:int
ogc_string()[source]

Returns a string of the form authority:id representing the CRS.

Parameters:self (CRS) – An enum constant representing a coordinate reference system.
Returns:A string representation of the CRS.
Return type:str
is_utm()[source]

Checks if crs is one of the 64 possible UTM coordinate reference systems.

Parameters:self (CRS) – An enum constant representing a coordinate reference system.
Returns:True if crs is UTM and False otherwise
Return type:bool
projection[source]

Returns a projection in form of pyproj class. For better time performance it will cache results of 5 most recently used CRS classes.

Parameters:self (CRS) – An enum constant representing a coordinate reference system.
Returns:pyproj projection class
Return type:pyproj.Proj
get_transform_function[source]

Returns a function for transforming geometrical objects from one CRS to another. The function will support transformations between any objects that pyproj supports. For better time performance this method will cache results of 10 most recently used pairs of CRS classes.

Parameters:
  • self (CRS) – Initial CRS
  • other (CRS) – Target CRS
Returns:

A projection function obtained from pyproj package

Return type:

function

class sentinelhub.constants.CustomUrlParam[source]

Bases: enum.Enum

Enum class to represent supported custom url parameters of OGC services

Supported parameters are SHOWLOGO, ATMFILTER, EVALSCRIPT, EVALSCRIPTURL, PREVIEW, QUALITY, UPSAMPLING, DOWNSAMPLING, TRANSPARENT, BGCOLOR and GEOMETRY.

See http://sentinel-hub.com/develop/documentation/api/custom-url-parameters and https://www.sentinel-hub.com/develop/documentation/api/ogc_api/wms-parameters for more information.

class sentinelhub.constants.HistogramType[source]

Bases: enum.Enum

Enum class for types of histogram supported by Sentinel Hub FIS service

Supported histogram types are EQUALFREQUENCY, EQUIDISTANT and STREAMING

class sentinelhub.constants.MimeType[source]

Bases: enum.Enum

Enum class to represent supported image file formats

Supported file formats are TIFF 8-bit, TIFF 16-bit, TIFF 32-bit float, PNG, JPEG, JPEG2000, JSON, CSV, ZIP, HDF5, XML, GML, RAW

is_image_format()[source]

Checks whether file format is an image format

Example: MimeType.PNG.is_image_format() or MimeType.is_image_format(MimeType.PNG)

Parameters:self (MimeType) – File format
Returns:True if file is in image format, False otherwise
Return type:bool
is_tiff_format()[source]

Checks whether file format is a TIFF image format

Example: MimeType.TIFF.is_tiff_format() or MimeType.is_tiff_format(MimeType.TIFF)

Parameters:self (MimeType) – File format
Returns:True if file is in image format, False otherwise
Return type:bool
get_string()[source]

Get file format as string

Returns:String describing the file format
Return type:str
get_sample_type()[source]

Returns sampleType used in Sentinel-Hub evalscripts.

Returns:sampleType
Return type:str
Raises:ValueError
get_expected_max_value()[source]

Returns max value of image MimeType format and raises an error if it is not an image format

Note: For MimeType.TIFF_d32f it will return 1.0 as that is expected maximum for an image even though it could be higher.

Returns:A maximum value of specified image format
Return type:int or float
Raises:ValueError
class sentinelhub.constants.RequestType[source]

Bases: enum.Enum

Enum constant class for GET/POST request type

class sentinelhub.constants.OgcConstants[source]

Bases: object

Initialisation of constants used by OGC request.

Constants are LATEST

class sentinelhub.constants.AwsConstants[source]

Bases: object

Initialisation of every constant used by AWS classes

For each supported data source it contains lists of all possible bands and all posible metadata files:

  • S2_L1C_BANDS and S2_L1C_METAFILES
  • S2_L2A_BANDS and S2_L2A_METAFILES

It also contains dictionary of all possible files and their formats: AWS_FILES

class sentinelhub.constants.EsaSafeType[source]

Bases: enum.Enum

Enum constants class for ESA .SAFE type.

Types are OLD_TYPE and COMPACT_TYPE