Question

Extract pixel from raster

  • 12 June 2017
  • 5 replies
  • 32 views

Userlevel 4
Badge +30

Hello Team,

My customer has a source data and the goal is extract just a yellow line from it.

 

The problem is when i use the transformer ( RasterCellCoercer ) after my source data the time and performance to get the polygons is not good.

 

I believe the transformer RasterExpressionEvaluator is a right solution to find these values RGB

Attachment my template file.

Thanks in Advance,

Danilo de Lima


5 replies

Badge +22

Converting from raster to vector in FME is notoriously slow.

 

You are on the right track for ways to improve performance. If you use the RasterExpressionEvaluator to create a 1 band image where your yellow RGB value(s) have a value of 1, and everything else 0, and then set the Nodata Value to 0 (RasterBandNoDataSetter) then the coersion should be more efficient.

 

 

You can also experiment to see of the RasterExtentsCoercer (DataExtents) or RasterToPolygonCoercer is more efficient than the RasterCellCoercer for your particular data.
Userlevel 4
Badge +13

Hi @danilo_inovacao Yep you will see a vast improvement in perforamnce if you do as @jdh suggests. For your particular case you can use this expression in the RasterExpressionEvaluator (use Int8 as the

interpretation):

@if(A[0]==255 && A[1]==251 && A[2]==134,1,0)

 

 

Follow this with a RasterBandNoDataSetter to set 0 = NoData and then a RasterToPolygonCoercer to get it into vectors and Bob's your uncle! The process shouldn't take any longer than 5 seconds!

 

 

Badge

The output should be a line or a polygon?

 

 

Anyway, I have experienced that a 'Generalizer' after this raster-to-vector conversion can be helpful in further processing. Just saying!
Userlevel 4
Badge +30

Converting from raster to vector in FME is notoriously slow.

 

You are on the right track for ways to improve performance. If you use the RasterExpressionEvaluator to create a 1 band image where your yellow RGB value(s) have a value of 1, and everything else 0, and then set the Nodata Value to 0 (RasterBandNoDataSetter) then the coersion should be more efficient.

 

 

You can also experiment to see of the RasterExtentsCoercer (DataExtents) or RasterToPolygonCoercer is more efficient than the RasterCellCoercer for your particular data.
Thanks @jdh . Your suggestions was very important for me :)
Userlevel 4
Badge +30

The output should be a line or a polygon?

 

 

Anyway, I have experienced that a 'Generalizer' after this raster-to-vector conversion can be helpful in further processing. Just saying!
Hi @jneujen, the output is polygon.

 

Thanks your help :)

 

Reply