Skip to content

grdcut crash with externals when x_min > 0 #8751

@joa-quim

Description

@joa-quim

Triggered by GenericMappingTools/GMT.jl#1723

This works well

G = gmtread("@earth_relief_20m_p", R=:d)
grdcut(G,R="0/140/-90/0")

but this crashes

grdcut(G,R="1/140/-90/0")

The reason lies on what happens in gmt_grdio.c/gmt_grd_shift() (Why calling grdcut involves a grid shift?) and gmt_api.c/gmtapi_expand_headerpad() following a logic that I couldn't understand but the end result was that grid's header was assign very wrong pad and header.mx values.

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