stac.utils¶
Utility data structures and algorithms.
Module Contents¶
Attributes¶
- stac.utils.base_schemas_path¶
- stac.utils.templateLoader¶
- stac.utils.templateEnv¶
- class stac.utils.Utils¶
Utils STAC object.
- static _get(url, params=None)¶
Query the STAC service using HTTP GET verb and return the result as a JSON document.
- Parameters
url (str) – The URL to query must be a valid STAC endpoint.
params (dict) – (optional) Dictionary, list of tuples or bytes to send in the query string for the underlying Requests.
- Return type
dict
- Raises
ValueError – If the response body does not contain a valid json.
- static validate(stac_object)¶
Validate a STAC Object using its jsonschema.
- Parameters
stac_object – A STAC object.
- Raises
ValidationError – raise a ValidationError if the STAC Object couldn’t be validated.
- static render_html(template_name, **kwargs)¶
Render Jinja2 HTML template.
- static build_bbox(bbox)¶
Define a common way to create the minimum bounding region.
- Parameters
bbox (Union[str,List[float],Tuple[float]]) – The bounding box
- Return type
shapely.geometry.base.BaseGeometry
- static build_bbox_as_str(bbox) str¶
Retrieve the string representation of a minimum bounding region.
- Parameters
bbox – The bounding box
- Return type
str
- static safe_request(url: str, method: str = 'get', **kwargs) requests.Response¶
Query the given URL for any HTTP Request and handle minimal HTTP Exceptions.
- Parameters
url – The URL to query.
method – HTTP Method name.
kwargs – (optional) Any argument supported by requests.request
:raise HTTPError - For any HTTP error related. :raise ConnectionError - For any error related ConnectionError such InternetError
- Return type
requests.Response