I’m currently trying to crop out areas of a GeoTiff that contain points from a shp file I have. I’m finding however that a spatial ‘contains’ query on the bounds of the GeoTiff actually gives back points outside what I deem to be the bounds of the data.
For example the above image shows that I have points outside of the SAR data and in my code these are also returned, is there a way for to extract only the ‘populated’ areas of a GeoTiff as a polygon?
The problem is that the black area is part of your product bounds but has no data.
As the black area has a constant fill value I can imagine two things you can do.
Filter you exported data afterwards for occurrences of this value and remove those records
Set the fill value as no-data value to the band and also enable the usage of this no-data value.
After wards you can ask band.isPixelValid(x, y)
Normally the outside area has a dedicated value, outside of the valid value range. Should be mentioned in the product spec.
How to do it is written here:
The last parameter ist actually outputImageScaleInDb and not outImageScaleInDb. At least if you use the “Calibration” operator.
No it is separate from the operator parameters.
If you have the final product and the band you can set:
myBand.setNoDataValue(42.24)
myBand.setNoDataValueUsed(true)
I thought that you iterate over the pixel manually and export them. Here you can check if the pixel is valid.
For doing pixel extraction there is also the so called PixEx operator. Maybe this one is of any use for you.