# Outside -90/+90 degree range: pygmt.info()/gmt info output for geographic data and -I option in polar latitudes

**URL:** <https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369>\
**Category:** Q&A\
**Created:** [November 24, 2021, 11:45pm UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369 "2021-11-24T23:45:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chhei](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/chhei/32/32_2.png) [@chhei](https://forum.generic-mapping-tools.org/u/chhei)\
**Post date:** [November 24, 2021, 11:45pm UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/1 "2021-11-24T23:45:57Z")

</div>

Hi all

I am generating a set of maps using `pygmt.info( data=myGeoDataFrame, spacing=4 )` to set the `region`. Now, one of the features I am plotting has vertices around -88.8˚S, resulting in a `-R-48/128/-92/-76` region definition. As I parse this straight into `pygmt.coast()` and a Mercator projection, pygmt rightly complains about `-92` being outside the -90/+90 degree range (this is for global features, so currently I am not worried too much about the projection).

As the geodataframe has an `EPSG:4326` projection, I would have assumed that `pygmt.info()` is clever enough to just give -90 as southern boundary. The same happens also with `OGR_GMT`-formatted data (` @Je4326` in header) and `gmt info`.

Bug or feature request to limit the increment output of `(py)gmt info` for geographic data to -90/+90 degree range?

Cheers,  
Christian

/edit: GMT 6.4.0\_965fc97-dirty\_2021.11.20, pygmt v0.5.0

---

<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:** [November 25, 2021, 12:06am UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/2 "2021-11-25T00:06:11Z")

</div>

You are probably not telling GMT that your data are geographic lon/lat. When I use **-fg** and get a region out of bounds, GMT will say this:

```
gmt info t.txt -I7 -fg
gmtinfo [WARNING]: Using -I caused wesn[YLO] to become < -90. Reset to -90.

-R0/35/-90/-84

```

[Note to self: wesn[YLO] really? You could not just write south?]. Of course, we cannot prevent you from using this with a Mercator projection and there is no “default” latitude for that anyway other than \< 90. If you plan to do this then you would be better off getting the w e s n values numerically and impose your own limits.

---

<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:** [November 25, 2021, 12:12am UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/3 "2021-11-25T00:12:26Z")

</div>

Perhaps the Pygmt wrapper can check for this and pass the -fg flag to the API.

---

<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:** [November 25, 2021, 12:18am UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/4 "2021-11-25T00:18:12Z")

</div>

> The same happens also with `OGR_GMT` -formatted data (` @Je4326` in header) and `gmt info`

That I may be able to fix in the core.

---

<div class="post-metadata">

**Author:** ![chhei](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/chhei/32/32_2.png) [@chhei](https://forum.generic-mapping-tools.org/u/chhei)\
**Post date:** [November 25, 2021, 6:47am UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/5 "2021-11-25T06:47:27Z")

</div>

Thanks Paul, clear case of RTFM and being too late in the case of `gmt info`.

[PyGMT.info()](https://www.pygmt.org/latest/api/generated/pygmt.info.html) however doesn’t seem to have a flag for geographic data indeed.

For now, I’ll probably post-process the string from `pygmt.info()` to make sure that it is -90 \< s \< 90 like you suggest.

Cheers,  
Christian

---

<div class="post-metadata">

**Author:** ![chhei](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/chhei/32/32_2.png) [@chhei](https://forum.generic-mapping-tools.org/u/chhei)\
**Post date:** [November 25, 2021, 8:06am UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/6 "2021-11-25T08:06:42Z")

</div>

For completeness, I am using for now:

```
    region = pygmt.info( data=gdf,spacing=4)
    if region[2] < -90:
        region[2] = 89.9.
    if region[3] > 90:
        region[3] = 89.9.

```

[edited to include @EJFielding’s suggestion]

---

<div class="post-metadata">

**Author:** ![EJFielding](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/ejfielding/32/82_2.png) [@EJFielding](https://forum.generic-mapping-tools.org/u/EJFielding)\
**Post date:** [November 25, 2021, 5:42pm UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/7 "2021-11-25T17:42:43Z")

</div>

If you are using the Mercator projection, you will get better results if you make the maximum latitude less than 90 degrees, like 89.9 degrees.

---

<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:** [November 25, 2021, 9:35pm UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/8 "2021-11-25T21:35:14Z")

</div>

CLI GMT master now understands the EPGS4326 in an OGR/GMT file (and hence shape files) at least, but doing this for the dataframe will need to take place in PyGMT.

---

<div class="post-metadata">

**Author:** ![chhei](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/chhei/32/32_2.png) [@chhei](https://forum.generic-mapping-tools.org/u/chhei)\
**Post date:** [November 27, 2021, 3:46pm UTC](https://forum.generic-mapping-tools.org/t/outside-90-90-degree-range-pygmt-info-gmt-info-output-for-geographic-data-and-i-option-in-polar-latitudes/2369/9 "2021-11-27T15:46:57Z")

</div>

Thanks @pwessel - Will test with the CLI version!

@EJFielding - much appreciated, have adopted my script & post accordingly.
