-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
- MTL document lists extents as they apply to pixel centers, but datacube expects extents that cover whole raster edge to edge
datacube-dataset-config/scripts/index_from_s3_bucket.py
Lines 78 to 84 in 5d20cf6
| def get_geo_ref_points(info): | |
| return { | |
| 'ul': {'x': info['CORNER_UL_PROJECTION_X_PRODUCT'], 'y': info['CORNER_UL_PROJECTION_Y_PRODUCT']}, | |
| 'ur': {'x': info['CORNER_UR_PROJECTION_X_PRODUCT'], 'y': info['CORNER_UR_PROJECTION_Y_PRODUCT']}, | |
| 'll': {'x': info['CORNER_LL_PROJECTION_X_PRODUCT'], 'y': info['CORNER_LL_PROJECTION_Y_PRODUCT']}, | |
| 'lr': {'x': info['CORNER_LR_PROJECTION_X_PRODUCT'], 'y': info['CORNER_LR_PROJECTION_Y_PRODUCT']}, | |
| } |
So recorded span is 15 meters (half a pixel) smaller than actual span.
- The usual error of incorrectly computing bounding box in Lon/Lat domain that assumes that projecting bounding box to Lon/Lat is the same as computing bounding box after projecting the whole shape into Lon/Lat with extra points added and then computing the bounding box
datacube-dataset-config/scripts/index_from_s3_bucket.py
Lines 87 to 94 in 5d20cf6
| def get_coords(geo_ref_points, spatial_ref): | |
| t = osr.CoordinateTransformation(spatial_ref, spatial_ref.CloneGeogCS()) | |
| def transform(p): | |
| lon, lat, z = t.TransformPoint(p['x'], p['y']) | |
| return {'lon': lon, 'lat': lat} | |
| return {key: transform(p) for key, p in geo_ref_points.items()} |
Metadata
Metadata
Assignees
Labels
No labels