# "Region extends beyond the horizon" error depending on map width

**URL:** <https://forum.generic-mapping-tools.org/t/region-extends-beyond-the-horizon-error-depending-on-map-width/4148>\
**Category:** Q&A\
**Created:** [July 26, 2023, 10:28am UTC](https://forum.generic-mapping-tools.org/t/region-extends-beyond-the-horizon-error-depending-on-map-width/4148 "2023-07-26T10:28:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefanfis](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@stefanfis](https://forum.generic-mapping-tools.org/u/stefanfis)\
**Post date:** [July 26, 2023, 10:28am UTC](https://forum.generic-mapping-tools.org/t/region-extends-beyond-the-horizon-error-depending-on-map-width/4148/1 "2023-07-26T10:28:36Z")

</div>

I’m trying to create a map of North America using the Lambert Azimuthal projection. Using this one liner works and gives the image shown below:  
`gmt coast -R-140.0/-1.0/2.0/53.0r -JA-100.0/45.0/5i -Gblue -png test5`

 ![test5](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/c/c3e1b9db5017707d3ac1b612ca015ce3057e415f.png)

I want to produce a larger image, though. I’m using basically the same command (width is now 6i instead of 5i):  
`gmt coast -R-140.0/-1.0/2.0/53.0r -JA-100.0/45.0/6i -Gblue -png test6`

But now I get this error messages:

```
coast [ERROR]: Rectangular region for azimuthal projection extends beyond the horizon
coast [ERROR]: Please select a region that is completely within the visible hemisphere
coast [ERROR]: General map projection error

```

I don’t understand how changing the scale of a map can lead to this kind of projection error.

To be sure that providing a different width in the command doesn’t change the plotted map region, I made maps for the widths 2i, 3i, 4i and 5i and resized them to the same pixel size. Overlaying those maps made it obvious that the plotted region did not change.

Some additional notes:

1. I see the same behavior when using `gmt grdimage`:  
`gmt grdimage @earth_relief_03m -R-145.0/-5.0/2.0/53.0r -JA-100.0/45.0/5i -png test-grd` works, but the very same command with 6i doesn’t.
2. When reducing the plotted area to `-140.0/2.0/-10.0/53.0` I can create even huge maps. 30i was the largest I tried and it worked.
3. Changing the projection center to anything reasonable within the map area did not help.

Version: GMT 6.4.0 on macOS Ventura 13.4

---

<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:** [July 26, 2023, 12:01pm UTC](https://forum.generic-mapping-tools.org/t/region-extends-beyond-the-horizon-error-depending-on-map-width/4148/2 "2023-07-26T12:01:53Z")

</div>

It is some sort of round-off. Will look when not so busy. Noticed that for your -R we can work around this test by changing the step:

**gmt coast -R-140.0/-1.0/2.0/53.0+r -JA-100.0/45.0/30i -Gblue -png test6 --MAP\_LINE\_STEP=4p**

We go around the rectangular border in map-line-step and gets the corresponding lon/lat and compute distance from origin. If over 90 then bam.

---

<div class="post-metadata">

**Author:** ![stefanfis](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@stefanfis](https://forum.generic-mapping-tools.org/u/stefanfis)\
**Post date:** [July 26, 2023, 12:14pm UTC](https://forum.generic-mapping-tools.org/t/region-extends-beyond-the-horizon-error-depending-on-map-width/4148/3 "2023-07-26T12:14:17Z")

</div>

Wow, thank you, that’s extremely helpful! Using **MAP\_LINE\_STEP** removes the error.
