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
3394cd08
Commit
3394cd08
authored
1 year ago
by
Lorenzo.Mercurio
Browse files
Options
Downloads
Patches
Plain Diff
outputs for fastapi
parent
ed908d24
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!5
Update branch
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
raster2stac/raster2stac.py
+305
-55
305 additions, 55 deletions
raster2stac/raster2stac.py
tests/list_objects_prefix.py
+20
-0
20 additions, 0 deletions
tests/list_objects_prefix.py
tests/raster2stac_test.py
+20
-6
20 additions, 6 deletions
tests/raster2stac_test.py
with
347 additions
and
62 deletions
.gitignore
+
2
−
1
View file @
3394cd08
...
...
@@ -4,4 +4,5 @@ results/
venv/
__pycache__/
result_NDVI/
out*
\ No newline at end of file
out*
data/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
raster2stac/raster2stac.py
+
305
−
55
View file @
3394cd08
This diff is collapsed.
Click to expand it.
tests/list_objects_prefix.py
0 → 100644
+
20
−
0
View file @
3394cd08
import
boto3
import
botocore
# Set your AWS credentials
aws_access_key
=
'
ak
'
aws_secret_key
=
'
sk
'
#aws_region = 'eu-south-2' # Change to your desired region
s3
=
boto3
.
client
(
'
s3
'
,
aws_access_key_id
=
aws_access_key
,
aws_secret_access_key
=
aws_secret_key
)
bucket_name
=
'
eurac-eo
'
file_name
=
'
process.json
'
prefix
=
'
test
'
paginator
=
s3
.
get_paginator
(
'
list_objects_v2
'
)
pages
=
paginator
.
paginate
(
Bucket
=
bucket_name
,
Prefix
=
prefix
)
for
page
in
pages
:
for
obj
in
page
[
'
Contents
'
]:
print
(
obj
[
'
Key
'
])
This diff is collapsed.
Click to expand it.
tests/raster2stac_test.py
+
20
−
6
View file @
3394cd08
...
...
@@ -31,17 +31,31 @@ from raster2stac import raster2stac as r2slib
local_data_folders
=
[
"
/home/lmercurio/dev/test-rio-stac/openeo-localprocessing-data/sample_netcdf
"
,
"
/home/lmercurio/dev/test-rio-stac/openeo-localprocessing-data/sample_geotiff
"
,
"
../data/test_basil
"
,
]
local_conn
=
LocalConnection
(
local_data_folders
)
local_collection
=
"
/home/lmercurio/dev/test-rio-stac/openeo-localprocessing-data/sample_netcdf/S2_L2A_sample.nc
"
#local_collection = "../data/test_basil/Bosco_2021_2023.nc"
local_collection
=
"
../data/test_michele/S2_L2A_sample.nc
"
s2_datacube
=
local_conn
.
load_collection
(
local_collection
)
exec_results
=
s2_datacube
.
execute
()
r2s
=
r2slib
.
Raster2STAC
(
exec_results
,
output_folder
=
'
./results/
'
,
collection_id
=
"
test-id
"
,
description
=
"
Description
"
,
output_file
=
'
test_collection.json
'
,
stac_version
=
"
1.0.0
"
,
verbose
=
True
)
providers
=
{
"
url
"
:
"
http://www.eurac.edu
"
,
"
name
"
:
"
Eurac EO WCS
"
,
"
roles
"
:[
"
host
"
]
}
#TITLE
#COLLECTION_ID
r2s
=
r2slib
.
Raster2STAC
(
exec_results
,
output_folder
=
'
./results/
'
,
collection_id
=
"
test-collection-1
"
,
description
=
"
Description
"
,
output_file
=
'
test_collection.json
'
,
stac_version
=
"
1.0.0
"
,
verbose
=
True
,
s3_upload
=
False
,
version
=
"
1.0
"
,
providers
=
providers
,
output_format
=
"
csv
"
,
title
=
"
Collection di test nr 1
"
,
collection_url
=
"
https://url-to-coll.col/collection
"
,
license
=
"
test-license
"
,
write_json_items
=
True
,
keywords
=
[
'
key1
'
,
'
key2
'
,
'
key3
'
,
'
key4
'
],
sci_citation
=
'
N/A
'
,
#url_collection=''
)
r2s
.
generate_stac
()
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