Convert latitude longitude grid to x Y grid in meters

Hi, I am trying to convert my file containing latitude, longitude, and parameter value into x y in meters.
I tried mapproject, but I am not sure whether it provides the correct output or not. My data are in 0.025 x 0.025-degree spatial resolution.

gmt mapproject latlon.txt $r -Jm0.025 > xy.txt

Later, I converted my file into a grid file using xyz2grd and tried to use grdproject, but the story was the same.

gmt grdproject $r -Jm0.025

It will be very much appreciated if I will get some suggestions on it.

1 Like

Long shot: try to add -C -F to those commands.

Yes, you are not plotting at x cm/degree you know; you want a scale 1:1 to do meters.

That’s mean I should follow

gmt mapproject latlon.txt $r -Jm0.025/1:1 -C -F > xy.txt

gmt grdproject $r -Jm0.025/1:1 -C -F

Are both correct?

1 Like

Why don’t you use the much simpler -J<proj4_string> variant?

I am sorry @Joaquim but I didn’t get you. I am using -Jm. Are you suggesting different?
could you please elaborate?

See the manual f -J . At the end it explains and has examples on how to use the proj4 syntax.