Skip to content

Commit

Permalink
Includ stac json in manifest.
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkinsspatial committed Oct 30, 2020
1 parent 0b792bb commit 5599dde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hls_manifest/hls_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Usage: create_manifest [OPTIONS]
Translate a file to a COG.
Example:
$ create_manifest ./hlsdata hlsmanifest.json hls-global HLSS30
Expand Down Expand Up @@ -71,7 +69,8 @@ def main(inputdir, outputfile, bucket, collection, product, jobid, gibs):
manifest["submissionTime"] = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ")
files = []
for filename in os.listdir(inputdir):
if filename.endswith(".tif") or filename.endswith(".jpg") or filename.endswith(".xml"):
if filename.endswith(".tif") or filename.endswith(".jpg") \
or filename.endswith(".xml") or filename.endswith("_stac.json"):
file_item = {}
file_item["name"] = filename
size = os.path.getsize(os.path.join(inputdir, filename))
Expand Down Expand Up @@ -99,6 +98,8 @@ def main(inputdir, outputfile, bucket, collection, product, jobid, gibs):
file_item["subtype"] = "ImageMetadata-v1.2"
if filename.endswith(".jpg"):
file_item["type"] = "browse"
if filename.endswith("_stac.json"):
file_item["type"] = "metadata"
else:
product_name = product
if filename.endswith(".tif"):
Expand All @@ -107,6 +108,8 @@ def main(inputdir, outputfile, bucket, collection, product, jobid, gibs):
file_item["type"] = "metadata"
if filename.endswith(".jpg"):
file_item["type"] = "browse"
if filename.endswith("_stac.json"):
file_item["type"] = "metadata"

files.append(file_item)
continue
Expand Down
Empty file added tests/data/test_stac.json
Empty file.

0 comments on commit 5599dde

Please sign in to comment.