Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Raster to STAC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
earth_observation_public
Raster to STAC
Commits
76687648
Commit
76687648
authored
7 months ago
by
Claus Michele
Browse files
Options
Downloads
Plain Diff
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
!21
Fix/parser and more
Pipeline
#45344
canceled
7 months ago
Stage: package_test
Stage: package_build
Stage: package_deployment
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
environment.yaml
+1
-1
1 addition, 1 deletion
environment.yaml
pyproject.toml
+17
-1
17 additions, 1 deletion
pyproject.toml
raster2stac/raster2stac.py
+3
-1
3 additions, 1 deletion
raster2stac/raster2stac.py
raster2stac/rioxarray_stac.py
+2
-2
2 additions, 2 deletions
raster2stac/rioxarray_stac.py
with
23 additions
and
5 deletions
environment.yaml
+
1
−
1
View file @
76687648
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
17
−
1
View file @
76687648
...
...
@@ -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"
,
...
...
This diff is collapsed.
Click to expand it.
raster2stac/raster2stac.py
+
3
−
1
View file @
76687648
...
...
@@ -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:
\n
x dimension:
{
self
.
X_DIM
}
\n
y dimension:
{
self
.
Y_DIM
}
\n
bands dimension:
{
self
.
B_DIM
}
\n
temporal 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
=
[]
...
...
This diff is collapsed.
Click to expand it.
raster2stac/rioxarray_stac.py
+
2
−
2
View file @
76687648
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment