opera-adt / disp-s1

OPERA Displacement workflows
Other
5 stars 7 forks source link

Create a data bounding polygon, add to `identification/bounding_polygon` #3

Closed scottstanie closed 3 weeks ago

scottstanie commented 11 months ago

The CSLC product has a /identification/bounding_polygon dataset, where they include WKT for the nodata boundary.

Possible implementation on example GSLC

gdal_calc.py -A NETCDF:t051_109451_iw3_20190329.h5:/data/VV --type Byte --co "COMPRESS=DEFLATE" --outfile not_nan_mask.tif --quiet --calc " ~numpy.isnan(A)"
gdal_polygonize.py -8 not_nan_mask.tif not_nan_polygons.shp 

Other questions

scottstanie commented 10 months ago

Well I said "does not close" this issue, but github thought that mean closed. Still open.

scottstanie commented 3 months ago

GDAL version 3.8 has added a gdal_footprint command, or the osgeo.gdal.Footprint utility which makes this simple:

$ time gdal_footprint -t_srs EPSG:4326  "netcdf:20221107_20230729.unw.nc:/unwrapped_phase" footprint.geojson
0...10...20...30...40...50...60...70...80...90...100 - done.

real    0m1.882s
user    0m1.769s
sys 0m0.102s

If we want, we can add somthing like -simplify 0.01 to make a less-precise polygon with fewer points (default is 100)

We should still verify that the results look okay, but my initial test looks decent:

image