rslearn 0.0.1__py3-none-any.whl → 0.0.21__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. rslearn/arg_parser.py +31 -0
  2. rslearn/config/__init__.py +6 -12
  3. rslearn/config/dataset.py +520 -401
  4. rslearn/const.py +9 -15
  5. rslearn/data_sources/__init__.py +8 -23
  6. rslearn/data_sources/aws_landsat.py +242 -98
  7. rslearn/data_sources/aws_open_data.py +111 -151
  8. rslearn/data_sources/aws_sentinel1.py +131 -0
  9. rslearn/data_sources/climate_data_store.py +471 -0
  10. rslearn/data_sources/copernicus.py +884 -12
  11. rslearn/data_sources/data_source.py +43 -12
  12. rslearn/data_sources/earthdaily.py +484 -0
  13. rslearn/data_sources/earthdata_srtm.py +282 -0
  14. rslearn/data_sources/eurocrops.py +242 -0
  15. rslearn/data_sources/gcp_public_data.py +578 -222
  16. rslearn/data_sources/google_earth_engine.py +461 -135
  17. rslearn/data_sources/local_files.py +219 -150
  18. rslearn/data_sources/openstreetmap.py +51 -89
  19. rslearn/data_sources/planet.py +24 -60
  20. rslearn/data_sources/planet_basemap.py +275 -0
  21. rslearn/data_sources/planetary_computer.py +798 -0
  22. rslearn/data_sources/usda_cdl.py +195 -0
  23. rslearn/data_sources/usgs_landsat.py +115 -83
  24. rslearn/data_sources/utils.py +249 -61
  25. rslearn/data_sources/vector_source.py +1 -0
  26. rslearn/data_sources/worldcereal.py +449 -0
  27. rslearn/data_sources/worldcover.py +144 -0
  28. rslearn/data_sources/worldpop.py +153 -0
  29. rslearn/data_sources/xyz_tiles.py +150 -107
  30. rslearn/dataset/__init__.py +8 -2
  31. rslearn/dataset/add_windows.py +2 -2
  32. rslearn/dataset/dataset.py +40 -51
  33. rslearn/dataset/handler_summaries.py +131 -0
  34. rslearn/dataset/manage.py +313 -74
  35. rslearn/dataset/materialize.py +431 -107
  36. rslearn/dataset/remap.py +29 -4
  37. rslearn/dataset/storage/__init__.py +1 -0
  38. rslearn/dataset/storage/file.py +202 -0
  39. rslearn/dataset/storage/storage.py +140 -0
  40. rslearn/dataset/window.py +181 -44
  41. rslearn/lightning_cli.py +454 -0
  42. rslearn/log_utils.py +24 -0
  43. rslearn/main.py +384 -181
  44. rslearn/models/anysat.py +215 -0
  45. rslearn/models/attention_pooling.py +177 -0
  46. rslearn/models/clay/clay.py +231 -0
  47. rslearn/models/clay/configs/metadata.yaml +295 -0
  48. rslearn/models/clip.py +68 -0
  49. rslearn/models/component.py +111 -0
  50. rslearn/models/concatenate_features.py +103 -0
  51. rslearn/models/conv.py +63 -0
  52. rslearn/models/croma.py +306 -0
  53. rslearn/models/detr/__init__.py +5 -0
  54. rslearn/models/detr/box_ops.py +103 -0
  55. rslearn/models/detr/detr.py +504 -0
  56. rslearn/models/detr/matcher.py +107 -0
  57. rslearn/models/detr/position_encoding.py +114 -0
  58. rslearn/models/detr/transformer.py +429 -0
  59. rslearn/models/detr/util.py +24 -0
  60. rslearn/models/dinov3.py +177 -0
  61. rslearn/models/faster_rcnn.py +30 -28
  62. rslearn/models/feature_center_crop.py +53 -0
  63. rslearn/models/fpn.py +19 -8
  64. rslearn/models/galileo/__init__.py +5 -0
  65. rslearn/models/galileo/galileo.py +595 -0
  66. rslearn/models/galileo/single_file_galileo.py +1678 -0
  67. rslearn/models/module_wrapper.py +65 -0
  68. rslearn/models/molmo.py +69 -0
  69. rslearn/models/multitask.py +384 -28
  70. rslearn/models/olmoearth_pretrain/__init__.py +1 -0
  71. rslearn/models/olmoearth_pretrain/model.py +421 -0
  72. rslearn/models/olmoearth_pretrain/norm.py +86 -0
  73. rslearn/models/panopticon.py +170 -0
  74. rslearn/models/panopticon_data/sensors/drone.yaml +32 -0
  75. rslearn/models/panopticon_data/sensors/enmap.yaml +904 -0
  76. rslearn/models/panopticon_data/sensors/goes.yaml +9 -0
  77. rslearn/models/panopticon_data/sensors/himawari.yaml +9 -0
  78. rslearn/models/panopticon_data/sensors/intuition.yaml +606 -0
  79. rslearn/models/panopticon_data/sensors/landsat8.yaml +84 -0
  80. rslearn/models/panopticon_data/sensors/modis_terra.yaml +99 -0
  81. rslearn/models/panopticon_data/sensors/qb2_ge1.yaml +34 -0
  82. rslearn/models/panopticon_data/sensors/sentinel1.yaml +85 -0
  83. rslearn/models/panopticon_data/sensors/sentinel2.yaml +97 -0
  84. rslearn/models/panopticon_data/sensors/superdove.yaml +60 -0
  85. rslearn/models/panopticon_data/sensors/wv23.yaml +63 -0
  86. rslearn/models/pick_features.py +17 -10
  87. rslearn/models/pooling_decoder.py +60 -7
  88. rslearn/models/presto/__init__.py +5 -0
  89. rslearn/models/presto/presto.py +297 -0
  90. rslearn/models/presto/single_file_presto.py +926 -0
  91. rslearn/models/prithvi.py +1147 -0
  92. rslearn/models/resize_features.py +59 -0
  93. rslearn/models/sam2_enc.py +13 -9
  94. rslearn/models/satlaspretrain.py +38 -18
  95. rslearn/models/simple_time_series.py +188 -77
  96. rslearn/models/singletask.py +24 -13
  97. rslearn/models/ssl4eo_s12.py +40 -30
  98. rslearn/models/swin.py +44 -32
  99. rslearn/models/task_embedding.py +250 -0
  100. rslearn/models/terramind.py +256 -0
  101. rslearn/models/trunk.py +139 -0
  102. rslearn/models/unet.py +68 -22
  103. rslearn/models/upsample.py +48 -0
  104. rslearn/models/use_croma.py +508 -0
  105. rslearn/template_params.py +26 -0
  106. rslearn/tile_stores/__init__.py +41 -18
  107. rslearn/tile_stores/default.py +409 -0
  108. rslearn/tile_stores/tile_store.py +236 -132
  109. rslearn/train/all_patches_dataset.py +530 -0
  110. rslearn/train/callbacks/adapters.py +53 -0
  111. rslearn/train/callbacks/freeze_unfreeze.py +348 -17
  112. rslearn/train/callbacks/gradients.py +129 -0
  113. rslearn/train/callbacks/peft.py +116 -0
  114. rslearn/train/data_module.py +444 -20
  115. rslearn/train/dataset.py +588 -235
  116. rslearn/train/lightning_module.py +192 -62
  117. rslearn/train/model_context.py +88 -0
  118. rslearn/train/optimizer.py +31 -0
  119. rslearn/train/prediction_writer.py +319 -84
  120. rslearn/train/scheduler.py +92 -0
  121. rslearn/train/tasks/classification.py +55 -28
  122. rslearn/train/tasks/detection.py +132 -76
  123. rslearn/train/tasks/embedding.py +120 -0
  124. rslearn/train/tasks/multi_task.py +28 -14
  125. rslearn/train/tasks/per_pixel_regression.py +291 -0
  126. rslearn/train/tasks/regression.py +161 -44
  127. rslearn/train/tasks/segmentation.py +428 -53
  128. rslearn/train/tasks/task.py +6 -5
  129. rslearn/train/transforms/__init__.py +1 -1
  130. rslearn/train/transforms/concatenate.py +54 -10
  131. rslearn/train/transforms/crop.py +29 -11
  132. rslearn/train/transforms/flip.py +18 -6
  133. rslearn/train/transforms/mask.py +78 -0
  134. rslearn/train/transforms/normalize.py +101 -17
  135. rslearn/train/transforms/pad.py +19 -7
  136. rslearn/train/transforms/resize.py +83 -0
  137. rslearn/train/transforms/select_bands.py +76 -0
  138. rslearn/train/transforms/sentinel1.py +75 -0
  139. rslearn/train/transforms/transform.py +89 -70
  140. rslearn/utils/__init__.py +2 -6
  141. rslearn/utils/array.py +8 -6
  142. rslearn/utils/feature.py +2 -2
  143. rslearn/utils/fsspec.py +90 -1
  144. rslearn/utils/geometry.py +347 -7
  145. rslearn/utils/get_utm_ups_crs.py +2 -3
  146. rslearn/utils/grid_index.py +5 -5
  147. rslearn/utils/jsonargparse.py +178 -0
  148. rslearn/utils/mp.py +4 -3
  149. rslearn/utils/raster_format.py +268 -116
  150. rslearn/utils/rtree_index.py +64 -17
  151. rslearn/utils/sqlite_index.py +7 -1
  152. rslearn/utils/vector_format.py +252 -97
  153. {rslearn-0.0.1.dist-info → rslearn-0.0.21.dist-info}/METADATA +532 -283
  154. rslearn-0.0.21.dist-info/RECORD +167 -0
  155. {rslearn-0.0.1.dist-info → rslearn-0.0.21.dist-info}/WHEEL +1 -1
  156. rslearn-0.0.21.dist-info/licenses/NOTICE +115 -0
  157. rslearn/data_sources/raster_source.py +0 -309
  158. rslearn/models/registry.py +0 -5
  159. rslearn/tile_stores/file.py +0 -242
  160. rslearn/utils/mgrs.py +0 -24
  161. rslearn/utils/utils.py +0 -22
  162. rslearn-0.0.1.dist-info/RECORD +0 -88
  163. /rslearn/{data_sources/geotiff.py → py.typed} +0 -0
  164. {rslearn-0.0.1.dist-info → rslearn-0.0.21.dist-info}/entry_points.txt +0 -0
  165. {rslearn-0.0.1.dist-info → rslearn-0.0.21.dist-info/licenses}/LICENSE +0 -0
  166. {rslearn-0.0.1.dist-info → rslearn-0.0.21.dist-info}/top_level.txt +0 -0
@@ -1,224 +1,328 @@
1
1
  """Base class for tile stores."""
2
2
 
3
- from datetime import datetime
4
3
  from typing import Any
5
4
 
6
5
  import numpy.typing as npt
6
+ from rasterio.enums import Resampling
7
+ from upath import UPath
7
8
 
8
- from rslearn.config import LayerConfig
9
9
  from rslearn.utils import Feature, PixelBounds, Projection
10
10
 
11
11
 
12
- class LayerMetadata:
13
- """Stores metadata about a TileStoreLayer."""
12
+ class TileStore:
13
+ """An abstract class for a tile store.
14
14
 
15
- def __init__(
16
- self,
17
- projection: Projection,
18
- time_range: tuple[datetime, datetime] | None,
19
- properties: dict[str, Any],
20
- ) -> None:
21
- """Create a new LayerMetadata instance."""
22
- self.projection = projection
23
- self.time_range = time_range
24
- self.properties = properties
25
-
26
- def serialize(self) -> dict:
27
- """Serializes the metadata to a JSON-encodable dictionary."""
28
- return {
29
- "projection": self.projection.serialize(),
30
- "time_range": (
31
- [self.time_range[0].isoformat(), self.time_range[1].isoformat()]
32
- if self.time_range
33
- else None
34
- ),
35
- "properties": self.properties,
36
- }
37
-
38
- @staticmethod
39
- def deserialize(d: dict) -> "LayerMetadata":
40
- """Deserializes metadata from a JSON-decoded dictionary."""
41
- return LayerMetadata(
42
- projection=Projection.deserialize(d["projection"]),
43
- time_range=(
44
- (
45
- datetime.fromisoformat(d["time_range"][0]),
46
- datetime.fromisoformat(d["time_range"][1]),
47
- )
48
- if d["time_range"]
49
- else None
50
- ),
51
- properties=d["properties"],
52
- )
15
+ A tile store supports operations to read and write raster and vector data.
16
+ """
53
17
 
18
+ def set_dataset_path(self, ds_path: UPath) -> None:
19
+ """Set the dataset path.
54
20
 
55
- class TileStoreLayer:
56
- """An abstract class for a layer in a tile store.
21
+ This is in case the TileStore wants to use the ds_path to help determine where
22
+ to store data.
57
23
 
58
- The layer can store one or more raster and vector datas.
59
- """
24
+ Args:
25
+ ds_path: the dataset path that this TileStore is a part of.
26
+ """
27
+ pass
60
28
 
61
- def read_raster(self, bounds: PixelBounds) -> npt.NDArray[Any] | None:
62
- """Read raster data from the store.
29
+ def is_raster_ready(
30
+ self, layer_name: str, item_name: str, bands: list[str]
31
+ ) -> bool:
32
+ """Checks if this raster has been written to the store.
63
33
 
64
34
  Args:
65
- bounds: the bounds within which to read
35
+ layer_name: the layer name or alias.
36
+ item_name: the item.
37
+ bands: the list of bands identifying which specific raster to read.
66
38
 
67
39
  Returns:
68
- the raster data
40
+ whether there is a raster in the store matching the source, item, and
41
+ bands.
69
42
  """
70
43
  raise NotImplementedError
71
44
 
72
- def write_raster(self, bounds: PixelBounds, array: npt.NDArray[Any]) -> None:
73
- """Write raster data to the store.
45
+ def get_raster_bands(self, layer_name: str, item_name: str) -> list[list[str]]:
46
+ """Get the sets of bands that have been stored for the specified item.
74
47
 
75
48
  Args:
76
- bounds: the bounds of the raster
77
- array: the raster data
49
+ layer_name: the layer name or alias.
50
+ item_name: the item.
51
+
52
+ Returns:
53
+ a list of lists of bands that are in the tile store (with one raster
54
+ stored corresponding to each inner list). If no rasters are ready for
55
+ this item, returns empty list.
78
56
  """
79
57
  raise NotImplementedError
80
58
 
81
- def read_vector(self, bounds: PixelBounds) -> list[Feature]:
82
- """Read vector data from the store.
59
+ def get_raster_bounds(
60
+ self, layer_name: str, item_name: str, bands: list[str], projection: Projection
61
+ ) -> PixelBounds:
62
+ """Get the bounds of the raster in the specified projection.
83
63
 
84
64
  Args:
85
- bounds: the bounds within which to read
65
+ layer_name: the layer name or alias.
66
+ item_name: the item to check.
67
+ bands: the list of bands identifying which specific raster to read. These
68
+ bands must match the bands of a stored raster.
69
+ projection: the projection to get the raster's bounds in.
86
70
 
87
71
  Returns:
88
- the vector data
72
+ the bounds of the raster in the projection.
89
73
  """
90
74
  raise NotImplementedError
91
75
 
92
- def write_vector(self, data: list[Feature]) -> None:
93
- """Save vector tiles to the store.
76
+ def read_raster(
77
+ self,
78
+ layer_name: str,
79
+ item_name: str,
80
+ bands: list[str],
81
+ projection: Projection,
82
+ bounds: PixelBounds,
83
+ resampling: Resampling = Resampling.bilinear,
84
+ ) -> npt.NDArray[Any]:
85
+ """Read raster data from the store.
94
86
 
95
87
  Args:
96
- data: the vector data
97
- """
98
- raise NotImplementedError
88
+ layer_name: the layer name or alias.
89
+ item_name: the item to read.
90
+ bands: the list of bands identifying which specific raster to read. These
91
+ bands must match the bands of a stored raster.
92
+ projection: the projection to read in.
93
+ bounds: the bounds to read.
94
+ resampling: the resampling method to use in case reprojection is needed.
99
95
 
100
- def get_metadata(self) -> LayerMetadata:
101
- """Get the LayerMetadata associated with this layer."""
96
+ Returns:
97
+ the raster data
98
+ """
102
99
  raise NotImplementedError
103
100
 
104
- def set_property(self, key: str, value: Any) -> None:
105
- """Set a property in the metadata for this layer.
101
+ def write_raster(
102
+ self,
103
+ layer_name: str,
104
+ item_name: str,
105
+ bands: list[str],
106
+ projection: Projection,
107
+ bounds: PixelBounds,
108
+ array: npt.NDArray[Any],
109
+ ) -> None:
110
+ """Write raster data to the store.
106
111
 
107
112
  Args:
108
- key: the property key
109
- value: the property value
113
+ layer_name: the layer name or alias.
114
+ item_name: the item to write.
115
+ bands: the list of bands in the array.
116
+ projection: the projection of the array.
117
+ bounds: the bounds of the array.
118
+ array: the raster data.
110
119
  """
111
120
  raise NotImplementedError
112
121
 
122
+ def write_raster_file(
123
+ self, layer_name: str, item_name: str, bands: list[str], fname: UPath
124
+ ) -> None:
125
+ """Write raster data to the store.
113
126
 
114
- class TileStore:
115
- """An abstract class for a tile store.
116
-
117
- A tile store supports operations to read and write raster and vector data.
118
- """
127
+ Args:
128
+ layer_name: the layer name or alias.
129
+ item_name: the item to write.
130
+ bands: the list of bands in the array.
131
+ fname: the raster file.
132
+ """
133
+ raise NotImplementedError
119
134
 
120
- def create_layer(
121
- self, layer_id: tuple[str, ...], metadata: LayerMetadata
122
- ) -> TileStoreLayer:
123
- """Create a layer in the tile store (or get matching existing layer).
135
+ def is_vector_ready(self, layer_name: str, item_name: str) -> bool:
136
+ """Checks if this vector item has been written to the store.
124
137
 
125
138
  Args:
126
- layer_id: the id of the layer to create
127
- metadata: metadata about the layer
139
+ layer_name: the layer name or alias.
140
+ item_name: the item.
128
141
 
129
142
  Returns:
130
- a TileStoreLayer corresponding to the new or pre-existing layer
143
+ whether the vector data from the item has been stored.
131
144
  """
132
145
  raise NotImplementedError
133
146
 
134
- def get_layer(self, layer_id: tuple[str, ...]) -> TileStoreLayer | None:
135
- """Get a layer in the tile store.
147
+ def read_vector(
148
+ self,
149
+ layer_name: str,
150
+ item_name: str,
151
+ projection: Projection,
152
+ bounds: PixelBounds,
153
+ ) -> list[Feature]:
154
+ """Read vector data from the store.
136
155
 
137
156
  Args:
138
- layer_id: the id of the layer to get
157
+ layer_name: the layer name or alias.
158
+ item_name: the item to read.
159
+ projection: the projection to read in.
160
+ bounds: the bounds within which to read.
139
161
 
140
162
  Returns:
141
- the layer, or None if it does not exist yet.
163
+ the vector data
142
164
  """
143
165
  raise NotImplementedError
144
166
 
145
- def list_layers(self, prefix: tuple[str, ...] = tuple()) -> list[str]:
146
- """List options for next part of layer ID with the specified prefix.
167
+ def write_vector(
168
+ self, layer_name: str, item_name: str, features: list[Feature]
169
+ ) -> None:
170
+ """Write vector data to the store.
147
171
 
148
172
  Args:
149
- prefix: the prefix to match
150
-
151
- Returns:
152
- available options for next part of the layer ID
173
+ layer_name: the layer name or alias.
174
+ item_name: the item to write.
175
+ features: the vector data.
153
176
  """
154
177
  raise NotImplementedError
155
178
 
156
179
 
157
- class PrefixedTileStore(TileStore):
158
- """Wraps another tile store by adding prefix to all layer IDs."""
180
+ class TileStoreWithLayer:
181
+ """Convenience class to access TileStore in the context of a layer."""
159
182
 
160
- def __init__(self, tile_store: TileStore, prefix: tuple[str, ...]):
161
- """Initialize a new PrefixedTileStore.
183
+ def __init__(self, tile_store: TileStore, layer_name: str):
184
+ """Create a new TileStoreWithLayer.
162
185
 
163
186
  Args:
164
- tile_store: the tile store to wrap
165
- prefix: the prefix to add to the layer IDs
187
+ tile_store: underlying TileStore.
188
+ layer_name: the layer name.
166
189
  """
167
190
  self.tile_store = tile_store
168
- self.prefix = prefix
191
+ self.layer_name = layer_name
169
192
 
170
- def create_layer(
171
- self, layer_id: tuple[str, ...], metadata: LayerMetadata
172
- ) -> TileStoreLayer:
173
- """Create a layer in the tile store (or get matching existing layer).
193
+ def is_raster_ready(self, item_name: str, bands: list[str]) -> bool:
194
+ """Checks if this raster has been written to the store.
174
195
 
175
196
  Args:
176
- layer_id: the id of the layer to create
177
- metadata: metadata about the layer
197
+ item_name: the item.
198
+ bands: the list of bands identifying which specific raster to read.
178
199
 
179
200
  Returns:
180
- a TileStoreLayer corresponding to the new or pre-existing layer
201
+ whether there is a raster in the store matching the source, item, and
202
+ bands.
181
203
  """
182
- return self.tile_store.create_layer(self.prefix + layer_id, metadata)
204
+ return self.tile_store.is_raster_ready(self.layer_name, item_name, bands)
183
205
 
184
- def get_layer(self, layer_id: tuple[str, ...]) -> TileStoreLayer | None:
185
- """Get a layer in the tile store.
206
+ def get_raster_bands(self, item_name: str) -> list[list[str]]:
207
+ """Get the sets of bands that have been stored for the specified item.
186
208
 
187
209
  Args:
188
- layer_id: the id of the layer to get
210
+ item_name: the item.
189
211
 
190
212
  Returns:
191
- the layer, or None if it does not exist yet.
213
+ a list of lists of bands that are in the tile store (with one raster
214
+ stored corresponding to each inner list). If no rasters are ready for
215
+ this item, returns empty list.
192
216
  """
193
- return self.tile_store.get_layer(self.prefix + layer_id)
217
+ return self.tile_store.get_raster_bands(self.layer_name, item_name)
194
218
 
195
- def list_layers(self, prefix: tuple[str, ...] = tuple()) -> list[str]:
196
- """List options for next part of layer ID with the specified prefix.
219
+ def get_raster_bounds(
220
+ self, item_name: str, bands: list[str], projection: Projection
221
+ ) -> PixelBounds:
222
+ """Get the bounds of the raster in the specified projection.
197
223
 
198
224
  Args:
199
- prefix: the prefix to match
225
+ item_name: the item to check.
226
+ bands: the list of bands identifying which specific raster to read. These
227
+ bands must match the bands of a stored raster.
228
+ projection: the projection to get the raster's bounds in.
200
229
 
201
230
  Returns:
202
- available options for next part of the layer ID
231
+ the bounds of the raster in the projection.
203
232
  """
204
- return self.tile_store.list_layers(self.prefix + prefix)
233
+ return self.tile_store.get_raster_bounds(
234
+ self.layer_name, item_name, bands, projection
235
+ )
205
236
 
237
+ def read_raster(
238
+ self,
239
+ item_name: str,
240
+ bands: list[str],
241
+ projection: Projection,
242
+ bounds: PixelBounds,
243
+ resampling: Resampling = Resampling.bilinear,
244
+ ) -> npt.NDArray[Any]:
245
+ """Read raster data from the store.
246
+
247
+ Args:
248
+ item_name: the item to read.
249
+ bands: the list of bands identifying which specific raster to read. These
250
+ bands must match the bands of a stored raster.
251
+ projection: the projection to read in.
252
+ bounds: the bounds to read.
253
+ resampling: the resampling method to use in case reprojection is needed.
254
+
255
+ Returns:
256
+ the raster data
257
+ """
258
+ return self.tile_store.read_raster(
259
+ self.layer_name, item_name, bands, projection, bounds, resampling
260
+ )
206
261
 
207
- def get_tile_store_for_layer(
208
- tile_store: TileStore, layer_name: str, layer_config: LayerConfig
209
- ) -> TileStore:
210
- """Returns a tile store prefixed for the given layer.
262
+ def write_raster(
263
+ self,
264
+ item_name: str,
265
+ bands: list[str],
266
+ projection: Projection,
267
+ bounds: PixelBounds,
268
+ array: npt.NDArray[Any],
269
+ ) -> None:
270
+ """Write raster data to the store.
211
271
 
212
- Args:
213
- tile_store: the base tile store.
214
- layer_name: the name of the layer.
215
- layer_config: the layer configuration, used to check if an alias is set.
272
+ Args:
273
+ item_name: the item to write.
274
+ bands: the list of bands in the array.
275
+ projection: the projection of the array.
276
+ bounds: the bounds of the array.
277
+ array: the raster data.
278
+ """
279
+ self.tile_store.write_raster(
280
+ self.layer_name, item_name, bands, projection, bounds, array
281
+ )
216
282
 
217
- Returns:
218
- appropriately prefixed tile store.
219
- """
220
- if layer_config.alias:
221
- layer_alias = layer_config.alias
222
- else:
223
- layer_alias = layer_name
224
- return PrefixedTileStore(tile_store, (layer_alias,))
283
+ def write_raster_file(self, item_name: str, bands: list[str], fname: UPath) -> None:
284
+ """Write raster data to the store.
285
+
286
+ Args:
287
+ item_name: the item to write.
288
+ bands: the list of bands in the array.
289
+ fname: the raster file.
290
+ """
291
+ self.tile_store.write_raster_file(self.layer_name, item_name, bands, fname)
292
+
293
+ def is_vector_ready(self, item_name: str) -> bool:
294
+ """Checks if this vector item has been written to the store.
295
+
296
+ Args:
297
+ item_name: the item.
298
+
299
+ Returns:
300
+ whether the vector data from the item has been stored.
301
+ """
302
+ return self.tile_store.is_vector_ready(self.layer_name, item_name)
303
+
304
+ def read_vector(
305
+ self, item_name: str, projection: Projection, bounds: PixelBounds
306
+ ) -> list[Feature]:
307
+ """Read vector data from the store.
308
+
309
+ Args:
310
+ item_name: the item to read.
311
+ projection: the projection to read in.
312
+ bounds: the bounds within which to read.
313
+
314
+ Returns:
315
+ the vector data
316
+ """
317
+ return self.tile_store.read_vector(
318
+ self.layer_name, item_name, projection, bounds
319
+ )
320
+
321
+ def write_vector(self, item_name: str, features: list[Feature]) -> None:
322
+ """Write vector data to the store.
323
+
324
+ Args:
325
+ item_name: the item to write.
326
+ features: the vector data.
327
+ """
328
+ self.tile_store.write_vector(self.layer_name, item_name, features)