Datetime bound to centroid
DatetimeBoundToCentroidExtract
Bases: ExtractionMethod
Accepts a dictionary of coordinate values and converts to RFC 7946, section 5 <https://tools.ietf.org/html/rfc7946#section-5>_
formatted bbox.
Method name: datetime_bound_to_centroid
Example Configuration
.. code-block:: yaml
- method: datetime_bound_to_centroid
inputs:
start_datetime: $start_date
end_datetime: 2022-02-02
end_format: %Y-%m-%d
output_key: polygon
Source code in extraction_methods/plugins/datetime_bound_to_centroid.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
strip_time(datetime_str, datetime_format)
strip datetime from value.
:param datetime_str: string to convert to datetime :type datetime_str: str :param datetime_format: format of datetime string :type datetime_format: str
:return: datetime object :rtype: datetime
Source code in extraction_methods/plugins/datetime_bound_to_centroid.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
DatetimeBoundToCentroidInput
Bases: Input
Model for Datetime Bound to Centroid Method Input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_datetime
|
str
|
Start datetime bound. |
'$start_datetime'
|
start_format
|
str
|
Format for start datetime. |
'%Y-%m-%dT%H:%M:%S'
|
end_datetime
|
str
|
End datetime bound. |
'$end_datetime'
|
end_format
|
str
|
Format of end datetime. |
'%Y-%m-%dT%H:%M:%S'
|
output_key
|
str
|
key to output to. |
'datetime'
|
output_format
|
str
|
format of output. |
'%Y-%m-%dT%H:%M:%SZ'
|
Source code in extraction_methods/plugins/datetime_bound_to_centroid.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |