Question

Extract pixel values from raster

  • 24 April 2018
  • 7 replies
  • 94 views

Badge +4

I would like to use the pixel values from a raster to proceed with different kind of analysis without converting to vector data. As you can see in the screenshot, in this case is the value from Band 0 (INT32) such as 50.

Best regards,

Felipe Verdú


7 replies

Userlevel 4
Badge +30

Hi @felipeverdu1

 

I believe you can use the transformer RasterCellCoercer and its possible to choose the point geometry.

Thanks,

Danilo

 

Userlevel 4
Badge +30

 

There is a similar question here: Extract Pixel from Raster

Badge +3

@felipeverdu1

You can create a point, offset or affine it by values like target_row,target_col. Using of course the raster extents (lower left corner for instance) and then use a PointOnRasterValueExtractor to extract the values at the target location.

Badge +3

pixel-value-extraction.fmw

@felipeverdu1

You can of course control the point creation any which way you like.

Still, GDAL or PIL (for python) can do pixel-targeting without having to create geometry first.

Badge +4

pixel-value-extraction.fmw

@felipeverdu1

You can of course control the point creation any which way you like.

Still, GDAL or PIL (for python) can do pixel-targeting without having to create geometry first.

Thank you so much, gio! I am going to try this out.

 

 

Badge +4
@gio and @danilo_fme: First of all, thans for your comments. I prefer not to use vector data but raster data since this is more effective and practical in my workflow. It is like in ArcGIS/Python using raster directly.
Badge +4

 

There is a similar question here: Extract Pixel from Raster

Hi

 

I solved this thing using a RasterExpressionEvaluator. It was my little knowledge of implementing if statements in the expression evaluator what hinder my understanding. Thanks, @danilo_fme

Reply