# How to convert geographic grid data to rectangular grid data or projected grid format

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92>\
**Category:** Q&A\
**Created:** [November 17, 2019, 7:14pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92 "2019-11-17T19:14:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [November 17, 2019, 7:14pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/1 "2019-11-17T19:14:46Z")

</div>

Hello senior GMT users, I am new to GMT, and trying out something I want to run a program that requires I convert my topography and Bouguer gravity grid data to projected grid format especially using transverse Mercator projection but I don’t know how to do it, Actually want to use it for calculation of effective elastic thickness using wavelet transform. please, what is the GMT function and script for this?

---

<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:** [November 18, 2019, 10:26am UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/2 "2019-11-18T10:26:43Z")

</div>

Try

`grdproject input.grd -Jt<central meridian>/1:1 -Goutput.grd -F`

---

<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:** [November 18, 2019, 12:21pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/3 "2019-11-18T12:21:36Z")

</div>

As a general rule, you should always consult the program’s manual page. Here [grdproject](https://docs.generic-mapping-tools.org/latest/grdproject.html)

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [November 18, 2019, 12:28pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/4 "2019-11-18T12:28:32Z")

</div>

@Andreas, many thanks it worked, though I have tried the example on the manual but this gave what I want

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [November 18, 2019, 12:30pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/5 "2019-11-18T12:30:23Z")

</div>

@Joaquim, many thanks , I have actually tried the examples on the manual but there is some differences in what Andreas sent and what is online. the second example online was not clear in some part.

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [November 18, 2019, 12:54pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/6 "2019-11-18T12:54:59Z")

</div>

the -Jt represent transverse Mercator, yes it worked, I have changed it to -Jm for Mercator projection. which still works, but other issues are if I have converted the data from geopraphic cordinate to cartesian cordinate or projected it, how can I re sample it using 20km grid spacing and know it projected dimension both easting and northing.  
example of this

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/3101e0d913f80ddf7f3dd7915afefbef3419101e.png)

---

<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:** [November 18, 2019, 2:13pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/7 "2019-11-18T14:13:46Z")

</div>

> [@John](#):
>
> there is some differences in what Andreas sent and what is online.

The examples in the man page cover different situations, although I agree that the example with `Jt-75/1:500000` is not the best example to show.

To set the resolution use the option **-D** , something like `-D20k` should produce a grid approximately at 20 km resolution.

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [November 18, 2019, 2:44pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/8 "2019-11-18T14:44:06Z")

</div>

OK Sir, many thank, am grateful. what I just want to do is similar to what is written on the picture I uploaded, I want to convert my data to projected or Cartesian coordinate using Mercator projection, then re sample the projected data on a 20 km grid spacing. You and Andreas have answered me, but am yet to try the re sampling as suggestion from your reply. Many thanks, but how can I know my dimension both easting and northing? I have used GMT to plot many maps but still learning by the way, the aspect of data conversion is an issue since the script online don’t work as expected.

---

<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:** [November 18, 2019, 3:08pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/9 "2019-11-18T15:08:54Z")

</div>

Use `grdinfo` on the output grid (`output.grd` in Andrea’s example) to know it’s caracteristics.

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [November 18, 2019, 3:12pm UTC](https://forum.generic-mapping-tools.org/t/how-to-convert-geographic-grid-data-to-rectangular-grid-data-or-projected-grid-format/92/10 "2019-11-18T15:12:33Z")

</div>

ok Professor. sure I want to try your suggestion now to see final out put
