Hi everyone,
I’m trying to do a subset in SNAPPY using the region parameter, but the function returns the full size product with no clipping done.
Has anyone managed to make it work before?
Cheers,
Alexandre
Hi everyone,
I’m trying to do a subset in SNAPPY using the region parameter, but the function returns the full size product with no clipping done.
Has anyone managed to make it work before?
Cheers,
Alexandre
Could you please provide the code used?
product = esa_snappy.ProductIO.readProduct(...)
rect = esa_snappy.jpy.get_type("java.awt.Rectangle")(x=10, y=10, width=100, height=100)
params = esa_snappy.HashMap()
params.put("region", rect)
product_clipped = esa_snappy.GPF.createProduct("Subset", params, product)
product and product_clipped have the same shape.
Could you try this code?
product = esa_snappy.ProductIO.readProduct(...)
x, y = 10, 10
width, height = 100, 100
params = esa_snappy.HashMap()
params .put('region', f'{x},{y},{width},{height}')
params .put('copyMetadata', True)
product_clipped = esa_snappy.GPF.createProduct("Subset", params, product)
That works. Thanks.