Using offline dataset

Hi,

I have download the earth_relief_01s dataset for offline use.
I have stored them in ~/.gmt/server/earth/earth_relief/earth_relief_01s_g/ (to stay consistent with the remote tree)

Now … How do I use it ?

gmt grdimage @earth_relief_01s -Rg -JG0/0/15c -B -png test

Thanks,

1 Like

And good luck plotting a 41 GB grid.

Looks like an interesting data set. The link leads to a directory full of 1 degree-square .jp2 files. Joaquim, can GMT ingest .jp2 files directly? Or is an additional gdal step required?

Did you use gmt get?

I think that this should work:

gmt get -Ddata=earth_relief -I01s

If not, then maybe you would need to provide the path to grdimage (or even better to set the dir in DIR_DATA).

Well, it can but that is done normally under the hood. Original data is stored in jp2 to minimize size and data transfer. Locally they are converted to netCDF and one access them with with the @earth_… syntax. Docs explain that.

This is something I would like to do as well.

@PlanetGus, instead of using tiles on the (remote) server, you would like to use those downloaded to a (local) directory, right?

Maybe you can set (or trick) the GMT_DATA_SERVER to be the local path to the directory, ~/.gmt/server/earth/earth_relief/earth_relief_01s_g/ in your case. Looks like curl doesn’t mind.

Ideally, it should be possible to tell gmt that the tiles are located locally, and to use those.

Why do you want to use the .jp2 instead of the nc versions of them?

I don’t have specific preferences for jp2,
I simply want to use the remote dataset locally, and if possible keeping the @earth… machinery to avoid to have to select the proper file (like joaquim said, a 41GB grid is a bit too much for a unique file).

The thing is, I don’t have internet connection to use gmt get, hence the post :slight_smile:

It’s the gmt remote dataset (igpp earth relief 1s)

First time the remote tiles are accessed they will be saved locally under ~./gmt/server and henceforward those local files will be used whenever a @earth_... (or @moon_, or @otherPlanet-but-not-Gus_...) requires them.

If you don’t have internet connection you can still copy that directory tree from a machine that has it and where the dataset has been downloaded.

It’s what I thought, but I suspect gmt needs to know they’ve been accessed, using a “hash server txt”… no?

O think not. That is done automatically once per day (when an attempt to use the tiles is done).

I’ll try again on monday in debug mode, but I’m pretty sure it failed yesterday :frowning:

Hehe

You never specified what you’re trying to do…? What do you normally do when using @grid’s?

Plot reliefs ? My main uses are map embellishments or topographical profiles along tracks :slight_smile:

And did you get the answer you needed?

Will see on Monday :slight_smile:

So :

  1. I have downloaded the @earth_relief_01m dataset :
    dir .gmt\server\earth\earth_relief\earth_relief_01m_g
    All other repo are empty (gmt clear cache)

  2. I try to use it :

gmt grdimage -RFR -JM10c @earth_relief_01m -B -W -png test
    grdimage [ERROR]: Remote download is currently deactivated
    grdimage [ERROR]: Unable to obtain remote file @earth_relief_01m

I tried @Andreas trick to change GMT_DATA_SERVER without success.

Any idea of how to “activate” remote download with no internet connection ?

Thanks for info. I’m going to play with this as well.

Maybe having an option do define GMT_DATA_SERVER as a local directory would be nice. I’m certain this would be very handy in some cases.

I suspect it does work … but that I have something off with my config Remote download is currently deactivated. Strange