indexation
This module contains stuff for the spatio-temporal indexation of scenes.
The scenes.indexation.Index uses an R-Tree to perform the indexation of
objects in the (x, y, t) domain.
Example: spatio-temporal indexation of multiple scenes.core.Scene instances.
Build a spatio temporal index¶
import scenes
scenes_list = [...] # a list of various `scenes.core.Scene` instances.
index = scenes.indexation.Index(scenes_list) # build the index
Search from a BoundingBox¶
The find_indices() method returns the indices of the indexed
scenes.core.Scene instances matching the query.
The find() method returns the indexed scenes.core.Scene instances matching
the query.
bbox = BoundingBox(43.706, 43.708, 4.317, 4.420)
indices_results = index.find_indices(bbox) # spatial query returning indices
scenes_results = index.find(bbox) # spatial query returning scenes instances
Spatio-temporal search¶
A date min and/or a date max can be added in the query.
Search from a vector data file¶
The search can also be performed with a vector data file.
Index
¶
Stores an indexation structure for a list of Scenes
Source code in scenes/indexation.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
__init__(scenes_list)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenes_list |
List[Scene]
|
list of scenes |
required |
Source code in scenes/indexation.py
find(vector_or_bbox, date_min=None, date_max=None)
¶
Search the intersecting scenes, and return them
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector_or_bbox |
Union[str, BoundingBox]
|
An input vector data file (str) or a bounding box in WGS84 (BoundingBox instance) |
required |
date_min |
Union[datetime, str]
|
date min (datetime or str) (Default value = None) |
None
|
date_max |
Union[datetime, str]
|
date max (datetime or str) (Default value = None) |
None
|
Returns:
| Type | Description |
|---|---|
List[Scene]
|
list of |
Source code in scenes/indexation.py
find_indices(vector_or_bbox, date_min=None, date_max=None)
¶
Search the intersecting scenes, and return their indices
The search is performed using the provided bounding box, or the provided input vector data file. The date_min and date_max are both optional.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector_or_bbox |
Union[str, BoundingBox]
|
An input vector data file (str) or a bounding box in WGS84 (BoundingBox instance) |
required |
date_min |
Union[datetime, str]
|
date min (datetime or str) (Default value = None) |
None
|
date_max |
Union[datetime, str]
|
date max (datetime or str) (Default value = None) |
None
|
Returns:
| Type | Description |
|---|---|
List[int]
|
list of indices |