Skip to content
Snippets Groups Projects
Commit 76687648 authored by Claus Michele's avatar Claus Michele
Browse files

Merge branch 'fix/parser' into 'main'

Fix/parser and more

See merge request !21
parents 782a9e3f d8a4989c
No related branches found
No related tags found
1 merge request!21Fix/parser and more
Pipeline #45344 canceled
......@@ -23,9 +23,9 @@ dependencies:
- boto3
- rio-cogeo
- openeo-processes-dask[implementations]
- openeo-pg-parser-networkx<=2024.4.0
- pystac-client
- openeo
- openeo-pg-parser-networkx
- rio-stac
- build
- setuptools>=61.0
......
......@@ -13,12 +13,28 @@ requires = [
"ujson",
"rio-cogeo",
"setuptools>=61.0",
"dask"
]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["raster2stac"]
[project]
name = "raster2stac"
version = "SEMANTIC_VERSION"
dependencies = [
"kerchunk",
"openeo-pg-parser-networkx==2024.4.0",
"openeo-processes-dask[implementations]",
"rio-stac",
"boto3",
"netcdf4==1.6.5",
"h5netcdf",
"h5py",
"ujson",
"openeo"
]
authors = [
{ name = "Michele Claus", email = "michele.claus@eurac.edu" },
{ name = "Lorenzo Mercurio", email = "lorenzo.mercurio@eurac.edu" },
......@@ -26,7 +42,7 @@ authors = [
]
description = "Create valid STAC Collections, Items and Assets given already existing raster datasets"
readme = "README.md"
requires-python = ">=3.6"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
......
......@@ -714,7 +714,6 @@ class Raster2STAC:
source_path = os.path.dirname(self.data)
local_conn = LocalConnection(source_path)
self.data = local_conn.load_collection(self.data).execute()
self.data_ds = self.data.to_dataset(dim=self.B_DIM)
else:
raise Exception(
"Please provide a path to a valid file or an xArray DataArray or Dataset object!"
......@@ -730,6 +729,9 @@ class Raster2STAC:
f"Extracted label dimensions from input are:\nx dimension:{self.X_DIM}\ny dimension:{self.Y_DIM}\nbands dimension:{self.B_DIM}\ntemporal dimension:{self.T_DIM}"
)
if self.data_ds is None:
self.data_ds = self.data.to_dataset(dim=self.B_DIM)
spatial_extents = []
temporal_extents = []
......
......@@ -223,7 +223,7 @@ def rioxarray_get_raster_info( # noqa: C901
# Missing `bits_per_sample` and `spatial_resolution`
# It should contain only one band/variable
# for band in src_dst.indexes:
if src_dst.attrs["scale_factor"]:
if src_dst.attrs.get("scale_factor",False):
value = {
"data_type": str(src_dst.dtype),
"scale": src_dst.attrs["scale_factor"],
......@@ -235,7 +235,7 @@ def rioxarray_get_raster_info( # noqa: C901
}
# add offset
if src_dst.attrs["add_offset"]:
if src_dst.attrs.get("add_offset",False):
value["offset"] = src_dst.attrs["add_offset"]
else:
value["offset"] = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment