Skip to main content
Question

How to replace a part of GeoTiff with new values

  • October 7, 2019
  • 1 reply
  • 102 views

arnovananrooij
Contributor
Forum|alt.badge.img+5

Hello,

I'm working with over a hundred huge non overlapping geotiff's (512 Mb each) where the band 0 value represents the height. I also have some polygons, which sometimes overlap multiple geotiffs. I would like to compute the maximum height from the geotiffs within that polygon and I would like to replace that part of the geotiff with this maximum height.

I managed to compute the maximum height so I created a shapefile with the polygons and the maximum height as an attribute and I also managed to create a Geotiff for eacht polygon with the maximum height as the band value.

Now I would like to get the last part of the job done: replace parts the original Geotiff whith the new geotiffs. I'm not sure how this could be done so any help is appreciated.

 

Arno

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • October 7, 2019

Hi @arnovananrooij, I would try this procedure.

  1. Clip the raster by the polygons with the Clipper.
  2. Extract the minimum value and the maximum value from the clipped rasters with the RasterBandMinMaxExtractor.
  3. For each clipped raster, replace all the cell values with the maximum value using the RasterCellValueReplacer (Replace Values >=: <minimum value>, New Value: <maximum value>).
  4. Mosaic the original raster and the clipped rasters with the RasterMosaicker (Overlapping Value: Maximum).

Hope this helps.

  1.