Skip to content

grdmath does not respect registration (-rp) when using gdal:GTIFF #8988

@anbj

Description

@anbj

When output is =gdal:GTIFF, -rp is not respected. Is this documented?

Creating the default .nc-file, things work:

$ gmt grdmath -rp -I0.1 -R0/1/0/1 0 = trash.nc
$ gmt grdinfo trash.nc 
trash.nc: Title: Produced by grdmath
trash.nc: Command: gmt grdmath -rp -I0.1 -R0/1/0/1 0 = trash.nc
trash.nc: Remark: 
trash.nc: Pixel node registration used [Cartesian grid] <------------------------- pixel
trash.nc: Grid file format: nf = GMT netCDF format (32-bit float), CF-1.7
trash.nc: x_min: 6.93889390391e-18 x_max: 1 x_inc: 0.1 name: x n_columns: 10
trash.nc: y_min: 6.93889390391e-18 y_max: 1 y_inc: 0.1 name: y n_rows: 10
trash.nc: v_min: 0 v_max: 0 name: z
trash.nc: scale_factor: 1 add_offset: 0
trash.nc: format: classic
trash.nc: Default CPT: 

Use =gdal:GTIFF, and -rp is ignored:

$ gmt grdmath -rp -I0.1 -R0/1/0/1 0 = trash.tif=gdal:GTIFF
$ gmt grdinfo trash.tif
trash.tif: Title: Grid imported via GDAL
trash.tif: Command: 
trash.tif: Remark: 
trash.tif: Gridline node registration used [Cartesian grid] <----------------------gridline, despite -rp
trash.tif: Grid file format: gd = Import/export through GDAL
trash.tif: x_min: 0.05 x_max: 0.95 x_inc: 0.1 name: x n_columns: 10
trash.tif: y_min: 0.05 y_max: 0.95 y_inc: 0.1 name: y n_rows: 10
trash.tif: v_min: 0 v_max: 0 name: z
trash.tif: scale_factor: 1 add_offset: 0
trash.tif: Default CPT: 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions