Skip to content

Commit 3c0d215

Browse files
authored
Remember tile registration and increment (#5978)
* Remember tile registration and increment We had a regression on this. When I started to create the grid headers only based on internal information about a tiled data set, I forgot to update a few places in gmt_init.c so that the increment and registration was stored in the API structure. This PR addresses this shortcoming. * Add test * Add test
1 parent c1189df commit 3c0d215

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/gmt_init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15511,7 +15511,8 @@ struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name,
1551115511
GMT->session.unit_name[GMT->current.setting.proj_length_unit], GMT->current.setting.graphics_dpu, GMT->current.setting.graphics_dpu_unit, this_n_per_degree, opt->arg, file);
1551215512
gmt_M_str_free (opt->arg);
1551315513
opt->arg = strdup (file);
15514-
d_inc = API->remote_info[k_data2].d_inc;
15514+
API->tile_inc = d_inc = API->remote_info[k_data2].d_inc;
15515+
API->tile_reg = API->remote_info[k_data2].reg;
1551515516
strncpy (s_inc, API->remote_info[k_data2].inc, GMT_LEN8);
1551615517
inc_set = true;
1551715518
gmt_M_memcpy (wesn, GMT->common.R.wesn, 4, double);

test/grdimage/autoresgrid.ps

469 KB
Binary file not shown.

test/grdimage/autoresgrid.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
# Ensure that the automatic detection of suitable grid resolution works
3+
# The -R -J and DPU below will request two earth_relief_05m_p tiles.
4+
5+
ps=autoresgrid.ps
6+
gmt grdimage @earth_relief -R-20/20/0/40 -JM10c --GMT_GRAPHICS_DPU=40c -P > $ps

0 commit comments

Comments
 (0)