is it possible to mask a Raster tile to the dimensions of a vector file. If i use the Land-Sea-Mask in snappy it returns a raster with values for the input multi polygon . But the file has still the dimensions of the input file. The area not included in the vector is filled with zeros. I want a file without any zeros. Just the dimension of the input vector file.
You’ll need to trim the image with subset. Determine where in the image the data starts being anything other than no data value for all four sides.
An easier way would be to get the bounding box of your vector geometry and then subset with that.
You can pass a geometry to subset and it will do just that.
subsetOp.setGeoRegion(geometry);