Skip to content

Commit

Permalink
edit time inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
baloola committed Jul 22, 2023
1 parent df81fc2 commit 8e88969
Show file tree
Hide file tree
Showing 60 changed files with 146 additions and 63 deletions.
17 changes: 13 additions & 4 deletions stac/stac-generator/collection_convertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,16 @@ def create_links(title):
]
)

date = extent["temporal"]["interval"][0][0]
if date is None:
date = '2000-01-01T00:00:00Z'
start_date = extent["temporal"]["interval"][0][0]
end_date = extent["temporal"]["interval"][0][1]
date = None
if start_date is None or end_date is None:
start_date = None
end_date = None
date = datetime.strptime('2000-01-01T00:00:00Z', "%Y-%m-%dT%H:%M:%SZ")
else:
start_date = datetime.strptime(start_date, "%Y-%m-%dT%H:%M:%SZ")
end_date = datetime.strptime(end_date, "%Y-%m-%dT%H:%M:%SZ")
extra_fields = dict()
for field in collection.extra_fields:
if field not in ["type", "cube:dimensions"]:
Expand All @@ -81,7 +88,9 @@ def create_links(title):
feature = pystac.Item(
id=collection.id,
stac_extensions=versioned_ext,
datetime=datetime.strptime(date, "%Y-%m-%dT%H:%M:%SZ"),
start_datetime=start_date,
end_datetime=end_date,
datetime=date,
bbox=bbox,
geometry=mapping(footprint),
properties=dict(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "ALOS_PALSAR2_AGRICULTURE",
"properties": {
"start_datetime": "2019-02-06T00:00:00Z",
"end_datetime": "2020-10-16T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -35,7 +37,7 @@
]
}
},
"datetime": "2019-02-06T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/ALOS_PALSAR2_L2_1_10M/ALOS_PALSAR2_L2_1_10M.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "ALOS_PALSAR2_L2_1_10M",
"properties": {
"start_datetime": "2019-03-06T00:00:00Z",
"end_datetime": "2021-04-08T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -35,7 +37,7 @@
]
}
},
"datetime": "2019-03-06T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/ALOS_PALSAR2_L2_1_3M/ALOS_PALSAR2_L2_1_3M.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "ALOS_PALSAR2_L2_1_3M",
"properties": {
"start_datetime": "2019-03-21T00:00:00Z",
"end_datetime": "2021-04-18T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2019-03-21T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "ALOS_PALSAR2_RICE_PADDY_FIELD_MAP",
"properties": {
"start_datetime": "2019-03-01T00:00:00Z",
"end_datetime": "2020-03-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2019-03-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/CAMS_GLC/CAMS_GLC.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "CAMS_GLC",
"properties": {
"start_datetime": "2017-01-01T00:00:00Z",
"end_datetime": "2017-01-01T00:00:01Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -36,7 +38,7 @@
]
}
},
"datetime": "2017-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/CDS_2M_TEMP_2020/CDS_2M_TEMP_2020.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "CDS_2M_TEMP_2020",
"properties": {
"start_datetime": "2019-01-01T00:00:00Z",
"end_datetime": "2022-04-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2019-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/CNES_LAND_COVER_MAP/CNES_LAND_COVER_MAP.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "CNES_LAND_COVER_MAP",
"properties": {
"start_datetime": "2016-01-01T00:00:00Z",
"end_datetime": "2021-01-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -37,7 +39,7 @@
]
}
},
"datetime": "2016-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
2 changes: 1 addition & 1 deletion stac_dist/CNR_CHL/CNR_CHL.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
]
}
},
"datetime": "2020-01-04T00:00:00Z"
"datetime": "2000-01-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
2 changes: 1 addition & 1 deletion stac_dist/CNR_TSM/CNR_TSM.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
]
}
},
"datetime": "2020-01-04T00:00:00Z"
"datetime": "2000-01-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/CORINE_LAND_COVER/CORINE_LAND_COVER.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "CORINE_LAND_COVER",
"properties": {
"start_datetime": "1990-01-01T00:00:00Z",
"end_datetime": "2018-01-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -38,7 +40,7 @@
]
}
},
"datetime": "1990-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "CORINE_LAND_COVER_ACCOUNTING_LAYERS",
"properties": {
"start_datetime": "2000-01-01T00:00:00Z",
"end_datetime": "2018-01-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -37,7 +39,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/E12C_MOTORWAY/E12C_MOTORWAY.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "E12C_MOTORWAY",
"properties": {
"start_datetime": "2017-05-15T00:00:00Z",
"end_datetime": "2020-05-15T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2017-05-15T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/E12D_PRIMARY/E12D_PRIMARY.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "E12D_PRIMARY",
"properties": {
"start_datetime": "2017-05-15T00:00:00Z",
"end_datetime": "2020-05-15T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2017-05-15T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/EMODNET_VESSEL_DENSITY/EMODNET_VESSEL_DENSITY.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "EMODNET_VESSEL_DENSITY",
"properties": {
"start_datetime": "2017-01-01T00:00:00Z",
"end_datetime": "2020-12-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2017-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "EMODNET_VESSEL_DENSITY_CARGO",
"properties": {
"start_datetime": "2017-01-01T00:00:00Z",
"end_datetime": "2020-12-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2017-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "EMODNET_VESSEL_DENSITY_OTHER",
"properties": {
"start_datetime": "2017-01-01T00:00:00Z",
"end_datetime": "2020-12-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2017-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "EMODNET_VESSEL_DENSITY_TANKER",
"properties": {
"start_datetime": "2017-01-01T00:00:00Z",
"end_datetime": "2020-12-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2017-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/ERA5_WIND_U/ERA5_WIND_U.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "ERA5_WIND_U",
"properties": {
"start_datetime": "2019-01-01T00:00:00Z",
"end_datetime": "2022-04-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2019-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/ERA5_WIND_V/ERA5_WIND_V.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "ERA5_WIND_V",
"properties": {
"start_datetime": "2019-01-01T00:00:00Z",
"end_datetime": "2022-04-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +36,7 @@
]
}
},
"datetime": "2019-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "ESA_WORLDCOVER_10M_2020_V1",
"properties": {
"start_datetime": "2020-01-01T00:00:00Z",
"end_datetime": "2021-01-01T00:00:01Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -35,7 +37,7 @@
]
}
},
"datetime": "2020-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
4 changes: 3 additions & 1 deletion stac_dist/GHS_BUILT_S2/GHS_BUILT_S2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"stac_version": "1.0.0",
"id": "GHS_BUILT_S2",
"properties": {
"start_datetime": "2018-01-01T00:00:00Z",
"end_datetime": "2018-01-01T00:00:01Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -120,7 +122,7 @@
]
}
},
"datetime": "2018-01-01T00:00:00Z"
"datetime": null
},
"geometry": {
"type": "Polygon",
Expand Down
Loading

0 comments on commit 8e88969

Please sign in to comment.