rioxarray 0.18.0__tar.gz → 0.18.1__tar.gz
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.
- {rioxarray-0.18.0/rioxarray.egg-info → rioxarray-0.18.1}/PKG-INFO +3 -2
- {rioxarray-0.18.0 → rioxarray-0.18.1}/pyproject.toml +3 -2
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/merge.py +32 -20
- {rioxarray-0.18.0 → rioxarray-0.18.1/rioxarray.egg-info}/PKG-INFO +3 -2
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray.egg-info/requires.txt +1 -1
- {rioxarray-0.18.0 → rioxarray-0.18.1}/AUTHORS.rst +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/CONTRIBUTING.rst +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/LICENSE +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/LICENSE_datacube +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/LICENSE_xarray +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/MANIFEST.in +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/README.rst +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/__init__.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/_io.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/_options.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/_show_versions.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/crs.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/exceptions.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/py.typed +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/raster_array.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/raster_dataset.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/raster_writer.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/rioxarray.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray/xarray_plugin.py +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray.egg-info/SOURCES.txt +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray.egg-info/dependency_links.txt +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray.egg-info/entry_points.txt +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/rioxarray.egg-info/top_level.txt +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/setup.cfg +0 -0
- {rioxarray-0.18.0 → rioxarray-0.18.1}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rioxarray
|
|
3
|
-
Version: 0.18.
|
|
3
|
+
Version: 0.18.1
|
|
4
4
|
Summary: geospatial xarray extension powered by rasterio
|
|
5
5
|
Maintainer: rioxarray Contributors
|
|
6
6
|
License: Apache
|
|
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
23
|
Classifier: Programming Language :: Python :: 3
|
|
23
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
25
|
Classifier: Typing :: Typed
|
|
@@ -29,7 +30,7 @@ License-File: LICENSE_datacube
|
|
|
29
30
|
License-File: LICENSE_xarray
|
|
30
31
|
License-File: AUTHORS.rst
|
|
31
32
|
Requires-Dist: packaging
|
|
32
|
-
Requires-Dist: rasterio>=1.3
|
|
33
|
+
Requires-Dist: rasterio>=1.3.7
|
|
33
34
|
Requires-Dist: xarray>=2024.7.0
|
|
34
35
|
Requires-Dist: pyproj>=3.3
|
|
35
36
|
Requires-Dist: numpy>=1.23
|
|
@@ -4,7 +4,7 @@ requires = ["setuptools", "wheel"]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "rioxarray"
|
|
7
|
-
version = "0.18.
|
|
7
|
+
version = "0.18.1"
|
|
8
8
|
description = "geospatial xarray extension powered by rasterio"
|
|
9
9
|
maintainers = [
|
|
10
10
|
{name = "rioxarray Contributors"},
|
|
@@ -27,6 +27,7 @@ classifiers = [
|
|
|
27
27
|
"Programming Language :: Python :: 3.10",
|
|
28
28
|
"Programming Language :: Python :: 3.11",
|
|
29
29
|
"Programming Language :: Python :: 3.12",
|
|
30
|
+
"Programming Language :: Python :: 3.13",
|
|
30
31
|
"Programming Language :: Python :: 3",
|
|
31
32
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
32
33
|
"Typing :: Typed",
|
|
@@ -34,7 +35,7 @@ classifiers = [
|
|
|
34
35
|
requires-python = ">=3.10"
|
|
35
36
|
dependencies = [
|
|
36
37
|
"packaging",
|
|
37
|
-
"rasterio>=1.3",
|
|
38
|
+
"rasterio>=1.3.7",
|
|
38
39
|
"xarray>=2024.7.0",
|
|
39
40
|
"pyproj>=3.3",
|
|
40
41
|
"numpy>=1.23",
|
|
@@ -12,7 +12,7 @@ from rasterio.merge import merge as _rio_merge
|
|
|
12
12
|
from xarray import DataArray, Dataset
|
|
13
13
|
|
|
14
14
|
from rioxarray._io import open_rasterio
|
|
15
|
-
from rioxarray.rioxarray import _get_nonspatial_coords
|
|
15
|
+
from rioxarray.rioxarray import _get_nonspatial_coords
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class RasterioDatasetDuck:
|
|
@@ -167,16 +167,35 @@ def merge_arrays(
|
|
|
167
167
|
memfile.name,
|
|
168
168
|
parse_coordinates=parse_coordinates,
|
|
169
169
|
mask_and_scale=rioduckarrays[0]._mask_and_scale,
|
|
170
|
-
) as
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
170
|
+
) as merged_data:
|
|
171
|
+
merged_data = merged_data.load()
|
|
172
|
+
|
|
173
|
+
# make sure old & new coorinate names match & dimensions are correct
|
|
174
|
+
rename_map = {}
|
|
175
|
+
original_extra_dim = representative_array.rio._check_dimensions()
|
|
176
|
+
new_extra_dim = merged_data.rio._check_dimensions()
|
|
177
|
+
# make sure the output merged data shape is 2D if the
|
|
178
|
+
# original data was 2D. this can happen if the
|
|
179
|
+
# xarray datasarray was squeezed.
|
|
180
|
+
if len(merged_data.shape) == 3 and len(representative_array.shape) == 2:
|
|
181
|
+
merged_data = merged_data.squeeze(
|
|
182
|
+
dim=new_extra_dim, drop=original_extra_dim is None
|
|
183
|
+
)
|
|
184
|
+
new_extra_dim = merged_data.rio._check_dimensions()
|
|
185
|
+
if (
|
|
186
|
+
original_extra_dim is not None
|
|
187
|
+
and new_extra_dim is not None
|
|
188
|
+
and original_extra_dim != new_extra_dim
|
|
189
|
+
):
|
|
190
|
+
rename_map[new_extra_dim] = original_extra_dim
|
|
191
|
+
if representative_array.rio.x_dim != merged_data.rio.x_dim:
|
|
192
|
+
rename_map[merged_data.rio.x_dim] = representative_array.rio.x_dim
|
|
193
|
+
if representative_array.rio.y_dim != merged_data.rio.y_dim:
|
|
194
|
+
rename_map[merged_data.rio.y_dim] = representative_array.rio.y_dim
|
|
195
|
+
if rename_map:
|
|
196
|
+
merged_data = merged_data.rename(rename_map)
|
|
197
|
+
merged_data.coords.update(_get_nonspatial_coords(representative_array))
|
|
198
|
+
return merged_data # type: ignore
|
|
180
199
|
|
|
181
200
|
|
|
182
201
|
def merge_datasets(
|
|
@@ -227,7 +246,7 @@ def merge_datasets(
|
|
|
227
246
|
|
|
228
247
|
representative_ds = datasets[0]
|
|
229
248
|
merged_data = {}
|
|
230
|
-
for data_var in representative_ds.data_vars:
|
|
249
|
+
for iii, data_var in enumerate(representative_ds.data_vars):
|
|
231
250
|
merged_data[data_var] = merge_arrays(
|
|
232
251
|
[dataset[data_var] for dataset in datasets],
|
|
233
252
|
bounds=bounds,
|
|
@@ -236,18 +255,11 @@ def merge_datasets(
|
|
|
236
255
|
precision=precision,
|
|
237
256
|
method=method,
|
|
238
257
|
crs=crs,
|
|
239
|
-
parse_coordinates=
|
|
258
|
+
parse_coordinates=iii == 0,
|
|
240
259
|
)
|
|
241
260
|
data_var = list(representative_ds.data_vars)[0]
|
|
242
261
|
xds = Dataset(
|
|
243
262
|
merged_data,
|
|
244
|
-
coords=_make_coords(
|
|
245
|
-
src_data_array=merged_data[data_var],
|
|
246
|
-
dst_affine=merged_data[data_var].rio.transform(),
|
|
247
|
-
dst_width=merged_data[data_var].shape[-1],
|
|
248
|
-
dst_height=merged_data[data_var].shape[-2],
|
|
249
|
-
force_generate=True,
|
|
250
|
-
),
|
|
251
263
|
attrs=representative_ds.attrs,
|
|
252
264
|
)
|
|
253
265
|
xds.rio.write_crs(merged_data[data_var].rio.crs, inplace=True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rioxarray
|
|
3
|
-
Version: 0.18.
|
|
3
|
+
Version: 0.18.1
|
|
4
4
|
Summary: geospatial xarray extension powered by rasterio
|
|
5
5
|
Maintainer: rioxarray Contributors
|
|
6
6
|
License: Apache
|
|
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
23
|
Classifier: Programming Language :: Python :: 3
|
|
23
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
25
|
Classifier: Typing :: Typed
|
|
@@ -29,7 +30,7 @@ License-File: LICENSE_datacube
|
|
|
29
30
|
License-File: LICENSE_xarray
|
|
30
31
|
License-File: AUTHORS.rst
|
|
31
32
|
Requires-Dist: packaging
|
|
32
|
-
Requires-Dist: rasterio>=1.3
|
|
33
|
+
Requires-Dist: rasterio>=1.3.7
|
|
33
34
|
Requires-Dist: xarray>=2024.7.0
|
|
34
35
|
Requires-Dist: pyproj>=3.3
|
|
35
36
|
Requires-Dist: numpy>=1.23
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|