geonode.thumbs.background
Attributes
Classes
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
Module Contents
- class geonode.thumbs.background.BaseThumbBackground(thumbnail_width: int, thumbnail_height: int, max_retries: int = 3, retry_delay: int = 1)[source]
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- class geonode.thumbs.background.GenericWMSBackground(thumbnail_width: int, thumbnail_height: int, max_retries: int = 3, retry_delay: int = 1)[source]
Bases:
BaseThumbBackgroundHelper class that provides a standard way to create an ABC using inheritance.
- bbox_to_projection(bbox: List)[source]
Function converting BBOX to target projection system, keeping the order of the coordinates. To ensure no additional change is performed, conversion is based on top-left and bottom-right points conversion.
- Parameters:
bbox – a dataset compliant BBOX: [west, east, south, north, CRS]
- fetch(bbox: List, *args, **kwargs)[source]
Function fetching background image, based on the given BBOX. On error should raise an exception or return None.
- Parameters:
bbox – a dataset compliant BBOX: [west, east, south, north, CRS]
args – not used, kept for API compatibility
kargs – not used, kept for API compatibility
- class geonode.thumbs.background.GenericXYZBackground(thumbnail_width: int, thumbnail_height: int, max_retries: int = 3, retry_delay: int = 1)[source]
Bases:
BaseThumbBackgroundHelper class that provides a standard way to create an ABC using inheritance.
- bbox3857to4326(x_min, x_max, y_min, y_max)[source]
Function converting BBOX from EPSG:3857 to EPSG:4326, keeping the order of the coordinates. To ensure no additional change is performed, conversion is based on top-left and bottom-right points conversion.
- bbox4326to3857(x_min, x_max, y_min, y_max)[source]
Function converting BBOX from EPSG:4326 to EPSG:3857, keeping the order of the coordinates. To ensure no additional change is performed, conversion is based on top-left and bottom-right points conversion.
- fetch(bbox: List, zoom: int = None, *args, **kwargs)[source]
The function fetching tiles from a Slippy Map provider, composing them into a single image, and cropping it to match the given BBOX. Retrieval of each tile is repeated self.max_retries times, waiting self.retry_delay seconds between consecutive requests.
- Parameters:
bbox – bounding box of the background image, dataset compliant format: [west, east, south, north, CRS]
zoom – zoom with which to retrieve Slippy Map’s tiles (by default, it’s calculated based on width, height)
- Returns:
None if the CRS is different from self.tiles_crs, or background Image
- class geonode.thumbs.background.WikiMediaTileBackground(thumbnail_width: int, thumbnail_height: int, max_retries: int = 3, retry_delay: int = 1)[source]
Bases:
GenericXYZBackgroundHelper class that provides a standard way to create an ABC using inheritance.
- class geonode.thumbs.background.OSMTileBackground(thumbnail_width: int, thumbnail_height: int, max_retries: int = 3, retry_delay: int = 1)[source]
Bases:
GenericXYZBackgroundHelper class that provides a standard way to create an ABC using inheritance.
- class geonode.thumbs.background.GenericWMTSBackground(thumbnail_width: int, thumbnail_height: int, max_retries: int = 3, retry_delay: int = 1)[source]
Bases:
BaseThumbBackgroundHelper class that provides a standard way to create an ABC using inheritance.