Skip to content

Commit b6d0af6

Browse files
committed
Needed new constant GMT_GRID_IS_GEO|CARTESIAN for API usage
1 parent c45acee commit b6d0af6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/gmt_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3537,8 +3537,8 @@ GMT_LOCAL struct GMT_DATASET *api_import_dataset (struct GMTAPI_CTRL *API, int o
35373537
if (!D_obj->min) D_obj->min = gmt_M_memory (GMT, NULL, D_obj->n_columns, double);
35383538
if (!D_obj->max) D_obj->max = gmt_M_memory (GMT, NULL, D_obj->n_columns, double);
35393539
}
3540-
gmtlib_set_dataset_minmax (GMT, D_obj); /* Set the min/max values for the entire dataset */
35413540
D_obj->geometry = geometry; /* Since gmtlib_read_table may have changed it */
3541+
gmtlib_set_dataset_minmax (GMT, D_obj); /* Set the min/max values for the entire dataset */
35423542
if (!via) API->object[this_item]->data = D_obj; /* Retain pointer to the allocated data so we use garbage collection later */
35433543
return (D_obj);
35443544
}
@@ -4651,6 +4651,7 @@ GMT_LOCAL int api_export_grid (struct GMTAPI_CTRL *API, int object_ID, unsigned
46514651
if (S_obj->region) { /* See if this is really a subset or just the same region as the grid */
46524652
if (G_obj->header->wesn[XLO] == S_obj->wesn[XLO] && G_obj->header->wesn[XHI] == S_obj->wesn[XHI] && G_obj->header->wesn[YLO] == S_obj->wesn[YLO] && G_obj->header->wesn[YHI] == S_obj->wesn[YHI]) S_obj->region = false;
46534653
}
4654+
if (mode & GMT_GRID_IS_GEO) gmt_set_geographic (GMT, GMT_OUT); /* From API to tell grid is geographic */
46544655
gmtlib_grd_set_units (GMT, G_obj->header); /* Ensure unit strings are set, regardless of destination */
46554656
switch (S_obj->method) {
46564657
case GMT_IS_FILE: /* Name of a grid file on disk */

src/gmt_resources.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ enum GMT_enum_dimindex {
251251
};
252252

253253
enum GMT_enum_gridio {
254+
GMT_GRID_IS_CARTESIAN = 0U, /* Grid is not geographic but Cartesian */
254255
GMT_GRID_IS_REAL = 0U, /* Read|write a normal real-valued grid */
255256
GMT_GRID_ALL = 0U, /* Read|write both grid header and the entire grid (no subset) */
256257
GMT_GRID_HEADER_ONLY = 1U, /* Just read|write the grid header */
@@ -261,7 +262,8 @@ enum GMT_enum_gridio {
261262
GMT_GRID_NO_HEADER = 16U, /* Write a native grid without the leading grid header */
262263
GMT_GRID_ROW_BY_ROW = 32U, /* Read|write the grid array one row at the time sequentially */
263264
GMT_GRID_ROW_BY_ROW_MANUAL = 64U, /* Read|write the grid array one row at the time in any order */
264-
GMT_GRID_XY = 128U}; /* Allocate and initialize x,y vectors */
265+
GMT_GRID_XY = 128U, /* Allocate and initialize x,y vectors */
266+
GMT_GRID_IS_GEO = 256U}; /* Grid is a geographic grid, not Cartesian */
265267

266268
/* These lengths (except GMT_GRID_VARNAME_LEN80) must NOT be changed as they are part of grd definition */
267269
enum GMT_enum_grdlen {

0 commit comments

Comments
 (0)