Skip to content

Commit

Permalink
Merge pull request #9 from NASA-IMPACT/include_stac
Browse files Browse the repository at this point in the history
Include stac json in manifest.
  • Loading branch information
sharkinsspatial authored Oct 30, 2020
2 parents 0b792bb + 5599dde commit aeb13fd
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 aeb13fd

Please sign in to comment.