Skip to main content
Question

Change the number of bands in a georeferenced .png raster

  • October 24, 2024
  • 2 replies
  • 44 views

repas4411
Contributor
Forum|alt.badge.img+2

I have over 30 000 .png files that have been georeferenced. However, some of the files have up to 3 or four bands when only 1 band is necessary. So I want to change this. 

 

I want to change the number of band from 4 or 3 to 1 for each file and then replace the old one with the new så I dont loose the accompanied georeferencing files. 

I also want some type of iterator for this, since i have my files in a directory tree: Directory → Subdir → folder → Files

2 replies

gisgeekpro
Contributor
Forum|alt.badge.img+4
  • Contributor
  • October 24, 2024

You can select multiple .png files by hitting the drop-down button in Dataset section of the Reader, and clicking on “Select Multiple Folders/Files”.

From there, you can use the combination of the RasterSelector to select the band that you would like to keep, together with the RasterBandKeeper that retains only the selected band. 

Afterwards you can right your new single band rasters to a new png file, using the fme_basename as a raster file name, so all your input images will be writter eperately. 

Hope this helps! 


hkingsbury
Celebrity
Forum|alt.badge.img+50
  • Celebrity
  • October 24, 2024
gisgeekpro wrote:

You can select multiple .png files by hitting the drop-down button in Dataset section of the Reader, and clicking on “Select Multiple Folders/Files”.

From there, you can use the combination of the RasterSelector to select the band that you would like to keep, together with the RasterBandKeeper that retains only the selected band. 

Afterwards you can right your new single band rasters to a new png file, using the fme_basename as a raster file name, so all your input images will be writter eperately. 

Hope this helps! 


You can also use wildcards in the file path :)
http://docs.safe.com/fme/2013/html/FME_QuickTranslator/content/fme%20configuration/dataset_wildcards.htm


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