Skip to content

Commit

Permalink
Update gmt_gdalwrite.c
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulWessel committed Dec 27, 2023
1 parent bc3d486 commit d1f3a73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gmt_gdalwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ int gmt_export_image (struct GMT_CTRL *GMT, char *fname, struct GMT_IMAGE *I) {
to_GDALW->ULx = I->header->wesn[XLO];
to_GDALW->ULy = I->header->wesn[YHI];
}
else {
to_GDALW->ULx = 1;
else if (I->header->wesn[XHI] > I->header->wesn[XLO] && I->header->wesn[YHI] > I->header->wesn[YLO]) { /* Header has valid -R */
to_GDALW->ULx = I->header->wesn[XLO];
to_GDALW->ULy = I->header->wesn[YHI];
}
else { /* Stuck with dimensions */
to_GDALW->ULx = 0;
to_GDALW->ULy = I->header->n_rows;
}

Expand Down

0 comments on commit d1f3a73

Please sign in to comment.