Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sat-utils/sat-stac-sentinel
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhanson committed Jan 29, 2020
2 parents b2e15b2 + 2e23e7a commit d431f9c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 187 deletions.
11 changes: 9 additions & 2 deletions lambda/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ def lambda_handler(event, context):

items = []
if 'sentinel-s1' in collection:
scene = SentinelSTAC(collection, metadata)
item = scene.to_stac(base_url='s3://%s/%s' % (collection, metadata['path']))
base_url = 's3://%s/%s' % (collection, metadata['path'])
fnames = [f"{base_url}/{a}" for a in metadata['filenameMap'].values() if 'annotation' in a and 'calibration' not in a]
md = {
'id': metadata['id'],
'coordinates': metadata['footprint']['coordinates'],
'filenames': fnames
}
scene = SentinelSTAC(collection, md)
item = scene.to_stac()
items.append(item)
else:
# there should never be more than one tile
Expand Down
4 changes: 1 addition & 3 deletions requirements-lambda.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#pyproj==2.4.1
#shapely~=1.6.4.post2
boto3-utils==0.0.3
boto3-utils==0.1.2
xmljson~=0.2.0
requests>=2.18.1
182 changes: 0 additions & 182 deletions samples/sentinel-s2-l1c_item.json

This file was deleted.

1 change: 1 addition & 0 deletions samples/sentinel-s2-l2a_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"Feature","stac_version":"0.9.0","stac_extensions":["dtr","sat","eo"],"id":"S2B_23VMF_20200102_0_L2A","collection":"sentinel-s2-l2a","bbox":[-46.76845394249839,58.962547187342146,-44.82743654507847,59.538226395172046],"geometry":{"type":"Polygon","coordinates":[[[-44.83032148699731,58.962547187342146],[-46.758918274502335,59.34318006505064],[-46.76845394249839,59.52639001577173],[-44.82743654507847,59.538226395172046],[-44.83032148699731,58.962547187342146]]]},"properties":{"constellation":"sentinel-2","instruments":["msi"],"eo:gsd":10,"eo:bands":[{"full_width_half_max":0.027,"center_wavelength":0.4439,"name":"B01","gsd":60,"common_name":"coastal"},{"full_width_half_max":0.098,"center_wavelength":0.4966,"name":"B02","gsd":10,"common_name":"blue"},{"full_width_half_max":0.045,"center_wavelength":0.56,"name":"B03","gsd":10,"common_name":"green"},{"full_width_half_max":0.038,"center_wavelength":0.6645,"name":"B04","gsd":10,"common_name":"red"},{"full_width_half_max":0.019,"center_wavelength":0.7039,"name":"B05","gsd":20},{"full_width_half_max":0.018,"center_wavelength":0.7402,"name":"B06","gsd":20},{"full_width_half_max":0.028,"center_wavelength":0.7825,"name":"B07","gsd":20},{"full_width_half_max":0.145,"center_wavelength":0.8351,"name":"B08","gsd":10,"common_name":"nir"},{"full_width_half_max":0.033,"center_wavelength":0.8648,"name":"B8A","gsd":20},{"full_width_half_max":0.026,"center_wavelength":0.945,"name":"B09","gsd":60},{"full_width_half_max":0.075,"center_wavelength":1.3735,"name":"B10","gsd":60,"common_name":"cirrus"},{"full_width_half_max":0.143,"center_wavelength":1.6137,"name":"B11","gsd":20,"common_name":"swir16"},{"full_width_half_max":0.242,"center_wavelength":2.22024,"name":"B12","gsd":20,"common_name":"swir22"}],"sat:off_nadir_angle":0,"datetime":"2020-01-02T14:35:53.297000+00:00","platform":"sentinel-2b","eo:cloud_cover":0,"sentinel:utm_zone":23,"sentinel:latitude_band":"V","sentinel:grid_square":"MF","sentinel:sequence":"0","sentinel:product_id":"S2B_MSIL2A_20200102T143519_N0213_R139_T23VMF_20200102T163733","created":"2020-01-03T22:48:53.994Z","updated":"2020-01-03T22:48:53.994Z"},"assets":{"thumbnail":{"title":"Thumbnail","type":"image/png","roles":["thumbnail"],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/preview.jpg"},"info":{"title":"Original JSON metadata","type":"application/json","roles":["metadata"],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/tileInfo.json"},"metadata":{"title":"Original XML metadata","type":"application/xml","roles":["metadata"],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/metadata.xml"},"overview":{"title":"True color image","type":"image/jp2","roles":["overview"],"eo:bands":[3,2,1],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/TCI.tif"},"B01":{"title":"Band 1 (coastal)","type":"image/jp2","roles":["analytic"],"eo:bands":[0],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B01.tif"},"B02":{"title":"Band 2 (blue)","type":"image/jp2","roles":["analytic"],"eo:bands":[2],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B02.tif"},"B03":{"title":"Band 3 (green)","type":"image/jp2","roles":["analytic"],"eo:bands":[2],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B03.tif"},"B04":{"title":"Band 4 (red)","type":"image/jp2","roles":["analytic"],"eo:bands":[3],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B04.tif"},"B05":{"title":"Band 5","type":"image/jp2","roles":["analytic"],"eo:bands":[4],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B05.tif"},"B06":{"title":"Band 6","type":"image/jp2","roles":["analytic"],"eo:bands":[5],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B06.tif"},"B07":{"title":"Band 7","type":"image/jp2","roles":["analytic"],"eo:bands":[6],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B07.tif"},"B08":{"title":"Band 8 (nir)","type":"image/jp2","roles":["analytic"],"eo:bands":[7],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B08.tif"},"B8A":{"title":"Band 8A","type":"image/jp2","roles":["analytic"],"eo:bands":[8],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B8A.tif"},"B09":{"title":"Band 9","type":"image/jp2","roles":["analytic"],"eo:bands":[9],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B09.tif"},"B10":{"title":"Band 10 (cirrus)","type":"image/jp2","roles":["analytic"],"eo:bands":[10],"href":"s3://sentinel-s2-l2a/tiles/23/V/MF/2020/1/2/0/R60m/B10.jp2"},"B11":{"title":"Band 11 (swir16)","type":"image/jp2","roles":["analytic"],"eo:bands":[11],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B11.tif"},"B12":{"title":"Band 12 (swir22)","type":"image/jp2","roles":["analytic"],"eo:bands":[12],"href":"https://cirrus-omega-data.s3.us-west-2.amazonaws.com/sentinel-s2-l2a/2020/S2B_23VMF_20200102_0_L2A/B12.tif"}},"links":[{"rel":"self","href":"https://fn8d3qzbhk.execute-api.us-west-2.amazonaws.com/omega/collections/sentinel-s2-l2a/items/S2B_23VMF_20200102_0_L2A"},{"rel":"parent","href":"https://fn8d3qzbhk.execute-api.us-west-2.amazonaws.com/omega/collections/sentinel-s2-l2a"},{"rel":"collection","href":"https://fn8d3qzbhk.execute-api.us-west-2.amazonaws.com/omega/collections/sentinel-s2-l2a"},{"rel":"root","href":"https://fn8d3qzbhk.execute-api.us-west-2.amazonaws.com/omega/"}]}

0 comments on commit d431f9c

Please sign in to comment.