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.ServiceUrl[source]

Bases: object

Most commonly used Sentinel Hub service URLs

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.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
opengis_string

Returns an URL to OGC webpage where the CRS is defined

Returns:An URL with CRS definition
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.

Returns:pyproj projection class
Return type:pyproj.Proj
pyproj_crs[source]

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

Returns:pyproj CRS class
Return type:pyproj.CRS
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
  • always_xy (bool) – Parameter that is passed to pyproj.Transformer object and defines axis order for transformation. The default value True is in most cases the correct one.
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, EVALSCRIPT, EVALSCRIPTURL, PREVIEW, QUALITY, UPSAMPLING, DOWNSAMPLING, GEOMETRY and WARNINGS.

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 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

extension

Returns file extension of the MimeType object

Returns:A file extension string
Return type:str
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_api_format()[source]

Checks if mime type is supported by Sentinel Hub API

Returns:True if API supports this format and False otherwise
Return type:bool
get_string()[source]

Get file format as string

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

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

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.SHConstants[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 collection it contains lists of all possible bands and all possible 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