Extract z value for a pair of x,y coordinates in grid file

Hello everyone

I am wondering if there is a method or gmt function to extract the z=depth value per pair of x=longitude,y=latitude coordinates of a grid file (slab geometry file). I would like to assign this “z” value to a variable in order to automatize a grid search algorithm. I am using gmt version 5.3.1.

I will appreciate if you can give me a clue about how to proceed.

Thanks in advance

See grdtrack for that sort of thing.

1 Like

Thanks
I will check :slight_smile:

It works perfectly! @pwessel. Thanks for the suggestion :star_struck: