# Hammer projection bug?

**URL:** https://forum.generic-mapping-tools.org/t/hammer-projection-bug/4543
**Category:** Q&A
**Created:** [December 27, 2023, 4:11pm UTC](https://forum.generic-mapping-tools.org/t/hammer-projection-bug/4543 "2023-12-27T16:11:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![thwbecker](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/thwbecker/32/1215_2.png) [@thwbecker](https://forum.generic-mapping-tools.org/u/thwbecker)
#### Post date: [December 27, 2023, 4:11pm UTC](https://forum.generic-mapping-tools.org/t/hammer-projection-bug/4543/1 "2023-12-27T16:11:04Z")

</div>

Hi,

using GMT from git, I am getting weird isssues with presumably geographic grids when the grd has negative longitudes and I am picking the projection center in the negative range. For example, make a grd

> grdmath -R-100/-50/-10/10 -I5 Y = tmp.grd

plot it with Robinson works fine  
\> grdimage -JN-50/2 tmp.grd \> tmp.ps  
(no issues)

but when I try Hammer

> grdimage -JH-50/2 tmp.grd \> tmp.ps  
> grdimage [ERROR]: Western boundary is \> 180 degrees from specified central meridian and thus your region is invalid  
> grdimage [ERROR]: General map projection error

Seems like this should not happen?

Thanks!

T

---

<div class="post-metadata">

### Author: ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)
#### Post date: [December 27, 2023, 5:10pm UTC](https://forum.generic-mapping-tools.org/t/hammer-projection-bug/4543/2 "2023-12-27T17:10:05Z")

</div>

Should not! But if the programmer (me) is so stoopid to not know that 410 degrees is probably 360 + 50 and by removing the 360 we are good to go. Just approved [https://github.com/GenericMappingTools/gmt/pull/8240#pullrequestreview-1797375609](https://github.com/GenericMappingTools/gmt/pull/8240#pullrequestreview-1797375609).

---

<div class="post-metadata">

### Author: ![thwbecker](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/thwbecker/32/1215_2.png) [@thwbecker](https://forum.generic-mapping-tools.org/u/thwbecker)
#### Post date: [December 27, 2023, 5:21pm UTC](https://forum.generic-mapping-tools.org/t/hammer-projection-bug/4543/3 "2023-12-27T17:21:58Z")

</div>

Thanks!
