The RasterCellCoercer will create polygons of your raster pixels and will allow you to specify row and column attributes. Then a ListBuilder grouped by row, a ListConcatenator to turn the list elements (the pixel values on that row) into a single attribute and write out to a CSV, that should do the trick.
Hi @bradmason2015, probably I finally found what Zonal Spatial Statistics is. I suppose you need to create a workflow which performs the same calculation as this functionality.
How Zonal Statistics works
If you have two rasters - ZoneRas and ValRas as shown in the above page, I think this workflow performs the Zonal Statistics. Assuming that the two input rasters have the same resolution.
- Send the ZoneRas to a RasterToPolygonCoercer (Label Attribute: _label)
Send the ValRas to a RasterCellCoercer (Output Cell Geometry: Points, Extract Band Values As: Attributes)- Add a Clipper to the workspace, send the polygons output from the RasterToPolygonCoercer to the Clipper port, send the points output from the RasterCellCoercer to the Clipee port, and check Merge Attributes checkbox.
- Send the points output from the Inside port of the Clipper to a StatisticsCalculator (Group By: _label, Attributes to Analyze: _band{0}.value).
- If necessary, connect a NumericRasterizer to the Complete port of the StatisticsCalculator to create a new raster based on your desired statistics value.
The RasterCellCoercer will create polygons of your raster pixels and will allow you to specify row and column attributes. Then a ListBuilder grouped by row, a ListConcatenator to turn the list elements (the pixel values on that row) into a single attribute and write out to a CSV, that should do the trick.
The translation is failing at the rastercellcoercer. Output cell geometry = polygons, extract band values as z values, preserve attributes = Yes, column attribute = 0 and row attribute =0, do those parameters make sense? All I need is a list of all of the elevations in the tiff? thanks
Hi @bradmason2015, probably I finally found what Zonal Spatial Statistics is. I suppose you need to create a workflow which performs the same calculation as this functionality.
How Zonal Statistics works
If you have two rasters - ZoneRas and ValRas as shown in the above page, I think this workflow performs the Zonal Statistics. Assuming that the two input rasters have the same resolution.
- Send the ZoneRas to a RasterToPolygonCoercer (Label Attribute: _label)
Send the ValRas to a RasterCellCoercer (Output Cell Geometry: Points, Extract Band Values As: Attributes)- Add a Clipper to the workspace, send the polygons output from the RasterToPolygonCoercer to the Clipper port, send the points output from the RasterCellCoercer to the Clipee port, and check Merge Attributes checkbox.
- Send the points output from the Inside port of the Clipper to a StatisticsCalculator (Group By: _label, Attributes to Analyze: _band{0}.value).
- If necessary, connect a NumericRasterizer to the Complete port of the StatisticsCalculator to create a new raster based on your desired statistics value.
Creating zones is a secondary problem for me. My main problem here is that my ZoneRas and ValRas are the same raster. I created a geotiff by subtracting one tiff from another to get elevation change in each pixel. I would like to export clipped areas of interest from the tiff using the z values in a text file or alternatively convert to a point shapefile. The goal would be to clip out areas of interest in the tiff or shapefile, export the attributes to a txt file and then analyze the elevations using a stats program. I tried converting tiff to .txt with fme but that doesn't work. I also tried converting the tiff to .txt using qgis but the resulting .xyz file is not readable. I would like to use the original raw data which is two point clouds instead of the tiffs like Hans has recommended but I am stumped there too. Point cloud xyz format is close to what I need as an end product for statistical analysis. any advice or further direction welcomed. thanks