Skip to main content

I have to generate dynamically an polygon to cut the border of my raster image.

i read this articel: https://knowledge.safe.com/articles/18764/setting-alpha-vs-nodata-color-and-numeric-data.html

Option #2 sounds good, but there is a static polygon (creator transformer) used.

i have to replace the creator and add something like a polygon generator based on my raster data.

this is a demo pic. the red polygon is the polygon mentioned that I would have to calculate.

I thought of something that compares the neighboring pixels and the strong deviation from this creates the line of the polygon. is there already a transformer? or is there another suitable solution for my problem?

sorry, i'm quite new with FME

edit: picture updated. the area with green lines should be removed

As far as I see the image you posted, looks the clipping operation has been performed fine. Could you please elaborate what the problem is?

 

 


As far as I see the image you posted, looks the clipping operation has been performed fine. Could you please elaborate what the problem is?

 

 

no there is nothing clipped. bad image but top and left of the image is a white border.

 

picture updated. area with green lines should be removed

 

 


Hi @cloc91, try clipping the raster by the red polygon using the Clipper. Make sure that the "Preserve Clipee Extents" parameter in the Clipper is set to "No".


Hi @cloc91, try clipping the raster by the red polygon using the Clipper. Make sure that the "Preserve Clipee Extents" parameter in the Clipper is set to "No".

I know, that i have to use the clipper. But first i have to generate the red polygon. This step is not clear how to generate the red polygon. The red polygon should be dynamic, because i have other tiles with different borders.

 

 


Hi @cloc91, try clipping the raster by the red polygon using the Clipper. Make sure that the "Preserve Clipee Extents" parameter in the Clipper is set to "No".

If the raster has Nodate definition and the white area is filled with Nodata cells, you can use the RasterExtentsCoercer (Extents Type: Data MBR Extents) to create a rectangle polygon representing the bounding box of the data area, which can be used as the clipper to remove the unnecessary border area.

 

 


If the raster has Nodate definition and the white area is filled with Nodata cells, you can use the RasterExtentsCoercer (Extents Type: Data MBR Extents) to create a rectangle polygon representing the bounding box of the data area, which can be used as the clipper to remove the unnecessary border area.

 

 

no, raster files has no NoData definition.

 

i think, i need something like the nearblack function from gdal https://www.gdal.org/nearblack.html

 

i can call it via batch or python, but is there a transformer, which does the same?
If the raster has Nodate definition and the white area is filled with Nodata cells, you can use the RasterExtentsCoercer (Extents Type: Data MBR Extents) to create a rectangle polygon representing the bounding box of the data area, which can be used as the clipper to remove the unnecessary border area.

 

 

If you can consider the cell value in the white area as Nodata, you can set the Nodata (maybe 255?) to the raster with the RasterBandNodataSetter.