Skip to main content
Question

Extract pixel values from raster


felipeverdu
Enthusiast
Forum|alt.badge.img+10

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

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • April 24, 2018

Hi @felipeverdu1

 

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

Thanks,

Danilo

 


danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • April 24, 2018

 

There is a similar question here: Extract Pixel from Raster


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • April 24, 2018

@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.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • April 24, 2018

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.


felipeverdu
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • April 25, 2018
gio wrote:

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.

 

 


felipeverdu
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • April 25, 2018
@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.

felipeverdu
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • April 25, 2018
danilo_fme wrote:

 

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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings