# Converting nc files to geotiff. Is it still possible?

**URL:** <https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865>\
**Category:** Q&A\
**Created:** [May 6, 2024, 12:26am UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865 "2024-05-06T00:26:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellyj](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@hellyj](https://forum.generic-mapping-tools.org/u/hellyj)\
**Post date:** [May 6, 2024, 12:26am UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/1 "2024-05-06T00:26:06Z")

</div>

Aloha.

After a long hiatus working on other things, I’m back to gmt6.

I am trying to convert a \*.nc file output from surface to a geotiff but don’t seem to be able to do that anymore with gdal or ogr2ogr. Either my memory (and code) are flaky or things have changed with gdal/ogr.

Can anyone advise me as to the current state-of-play in the conversion wars? None of my old methods seem to work.

J.

---

<div class="post-metadata">

**Author:** ![EJFielding](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/ejfielding/32/82_2.png) [@EJFielding](https://forum.generic-mapping-tools.org/u/EJFielding)\
**Post date:** [May 6, 2024, 3:39am UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/2 "2024-05-06T03:39:35Z")

</div>

Recent versions of GDAL no longer read the older GMT NetCDF grid formats. I found that I had to use GMT to read some of my older grids and save them again to get GMT to write them into a modern NetCDF file that GDAL can read. An easy trick is to use “grdmath oldGrd 1 MUL = newGrd”.

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [May 6, 2024, 8:06am UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/3 "2024-05-06T08:06:33Z")

</div>

Does

```auto
gdal_translate file.nc file.tif

```

Or

```auto
gmt grdconvert file.nc -Gfile.tif=gdal:GTIFF

```

work?

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [May 6, 2024, 11:14am UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/4 "2024-05-06T11:14:04Z")

</div>

Or write the grid directly in geotiff  
[https://docs.generic-mapping-tools.org/dev/surface.html#g](https://docs.generic-mapping-tools.org/dev/surface.html#g)

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [May 6, 2024, 11:15am UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/5 "2024-05-06T11:15:32Z")

</div>

> [@Andreas](#):
>
> `gmt grdconvert file.nc -Gfile.tif=gdal:GTIFF`

it’s `-Gfile.tif=gd:GTiff`, not `-Gfile.tif=gdal:GTIFF`

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [May 6, 2024, 11:28am UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/6 "2024-05-06T11:28:19Z")

</div>

Right, sorry.

---

<div class="post-metadata">

**Author:** ![hellyj](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@hellyj](https://forum.generic-mapping-tools.org/u/hellyj)\
**Post date:** [May 6, 2024, 10:18pm UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/7 "2024-05-06T22:18:34Z")

</div>

Mahalo for the replies. I’ll try them all.  
J.

---

<div class="post-metadata">

**Author:** ![hellyj](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@hellyj](https://forum.generic-mapping-tools.org/u/hellyj)\
**Post date:** [May 6, 2024, 10:45pm UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/8 "2024-05-06T22:45:37Z")

</div>

> [@Andreas](#):
>
> `gdal_translate file.nc file.tif`

Negative. Does not work.

---

<div class="post-metadata">

**Author:** ![hellyj](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@hellyj](https://forum.generic-mapping-tools.org/u/hellyj)\
**Post date:** [May 6, 2024, 10:45pm UTC](https://forum.generic-mapping-tools.org/t/converting-nc-files-to-geotiff-is-it-still-possible/4865/9 "2024-05-06T22:45:57Z")

</div>

grdconvert works.
