# Modify all values in a hazard geotiff

**URL:** <https://community.riskscape.org.nz/t/modify-all-values-in-a-hazard-geotiff/218>\
**Category:** Community\
**Created:** [15 May 2025 02:01 UTC](https://community.riskscape.org.nz/t/modify-all-values-in-a-hazard-geotiff/218 "2025-05-15T02:01:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPowell](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@JPowell](https://community.riskscape.org.nz/u/JPowell)\
**Post date:** [15 May 2025 02:01 UTC](https://community.riskscape.org.nz/t/modify-all-values-in-a-hazard-geotiff/218/1 "2025-05-15T02:01:07Z")

</div>

I have a pipeline that can be run using either of 2 sources for the hazard files. One source has the data in metres and the other has it in centimetres. Both sets of hazard files are defined in csvs. What is the best way to convert the data to metres?

MapsInMetres.csv

```auto
id,location,ARI,res
coastal_flooding,Data/Hazard/LiDAR/NZ_ARI10_0.tif,10,10
coastal_flooding,Data/Hazard/LiDAR/NZ_ARI20_0.tif,20,10
coastal_flooding,Data/Hazard/LiDAR/NZ_ARI50_0.tif,50,10
coastal_flooding,Data/Hazard/LiDAR/NZ_ARI100_0.tif,100,10
coastal_flooding,Data/Hazard/LiDAR/NZ_ARI200_0.tif,200,10
coastal_flooding,Data/Hazard/LiDAR/NZ_ARI500_0.tif,500,10
coastal_flooding,Data/Hazard/LiDAR/NZ_ARI1000_0.tif,1000,10

```

MapsInCm.csv

```auto
id,regioncode,location,ARI,deltaTemp,res
0,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI10_8m.tif,10,0,8
1,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI20_8m.tif,20,0,8
2,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI50_8m.tif,50,0,8
3,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI100_8m.tif,100,0,8
4,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI200_8m.tif,200,0,8
5,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI500_8m.tif,500,0,8
6,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI1000_8m.tif,1000,0,8

```

---

<div class="post-metadata">

**Author:** ![timbeale](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@timbeale](https://community.riskscape.org.nz/u/timbeale)\
**Post date:** [15 May 2025 02:19 UTC](https://community.riskscape.org.nz/t/modify-all-values-in-a-hazard-geotiff/218/2 "2025-05-15T02:19:47Z")

</div>

Kia ora John,

You can use `map-value` in the bookmark to convert the value sampled from the GeoTIFF:

> **[Coverage data — RiskScape 1.9.0 documentation](https://engine-docs.sites.riskscape.nz/reference/data/coverages.html#transform-the-sampled-value)**

So in your case, you would probably define 2 bookmarks like this:

```auto
[bookmark in_centimetres]
location = placeholder.tif
map-value = value / 100

[bookmark in_metres]
description = No mapping, the data is already in metres
location = placeholder.tif

```

And then add an extra column to your CSV with the ID of the bookmark to use.

Hope that helps.  
Tim

---

<div class="post-metadata">

**Author:** ![JPowell](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@JPowell](https://community.riskscape.org.nz/u/JPowell)\
**Post date:** [15 May 2025 23:21 UTC](https://community.riskscape.org.nz/t/modify-all-values-in-a-hazard-geotiff/218/3 "2025-05-15T23:21:48Z")

</div>

Hi Tim,  
Im not following sorry. My bookmarks point to a csv, I have added the map-value parameter but it does not make a difference.

```auto
[hazard_in_cm]
location = MapsInCm.csv
map-value = value / 100

```

Im not sure what you mean about adding an extra column to the csv  
Thanks

---

<div class="post-metadata">

**Author:** ![timbeale](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@timbeale](https://community.riskscape.org.nz/u/timbeale)\
**Post date:** [15 May 2025 23:57 UTC](https://community.riskscape.org.nz/t/modify-all-values-in-a-hazard-geotiff/218/4 "2025-05-15T23:57:34Z")

</div>

Hi John,

Sorry I wasn’t clear. You need to define the `map-value` bookmark for the _GeoTIFF_, not the _CSV_. And then use that bookmark when you load the GeoTIFF from the CSV.

So your MapsInCm.csv file might look like this:

```auto
id,regioncode,location,ARI,deltaTemp,res,bookmarkID
0,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI10_8m.tif,10,0,8,in_centimetres
1,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI20_8m.tif,20,0,8,in_centimetres
2,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI50_8m.tif,50,0,8,in_centimetres
3,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI100_8m.tif,100,0,8,in_centimetres
4,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI200_8m.tif,200,0,8,in_centimetres
5,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI500_8m.tif,500,0,8,in_centimetres
6,01,Data/Hazard/nationalFluvialPluvialMaps/01_ARI1000_8m.tif,1000,0,8,in_centimetres

```

And then in your pipeline you would do something like:

```auto
input($hazard_csv)
->
select({ *, bookmark(bookmarkID, { location: location }, type: 'coverage(floating)') as coverage })

```

Let me know if that still doesn’t make sense.

Tim

---

<div class="post-metadata">

**Author:** ![JPowell](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@JPowell](https://community.riskscape.org.nz/u/JPowell)\
**Post date:** [19 May 2025 00:20 UTC](https://community.riskscape.org.nz/t/modify-all-values-in-a-hazard-geotiff/218/5 "2025-05-19T00:20:40Z")

</div>

Hey Tim,  
Yes that makes sense. I have it working now.  
Thanks for your help!
