# Map up to the south pole. Bug in -R+uk?

**URL:** <https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053>\
**Category:** Q&A\
**Created:** [September 3, 2021, 12:18am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053 "2021-09-03T00:18:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 3, 2021, 12:18am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/1 "2021-09-03T00:18:45Z")

</div>

I want to make a rectangular map with a Lambert projection (-JA-60/-40/15c) that extends just up to the south pole (like [this map](https://www.ign.gob.ar/gallery-app/mapas-escolares/medium/argentina_bicontinental_mudo.jpg)).

So I using **-R** _xmin_/_xmax_/_ymin_/_ymax_ **+u** _unit_ to define the region. So I used this to calculated the distance to the South Pole which gives 5573 km.

` S=$(echo -60 -40 | gmt mapproject -G-60/-90+uk -o2)`

But I get this image. By try and error I found that I must used **-5420** to get the map that I want. Am I using the R method right? Is it a bug?

 ![SouthPole](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/f/f0870487f06b4a33d9bd011547747aa859064096.png)

```
#!/usr/bin/env bash
    	Lat=-40
    	S=$(echo -60 ${Lat} | gmt mapproject -G-60/-90+uk -o2)

    #	Region geografica del mapa
    	REGION=-2500/3100/-5573/2100+uk
        #REGION=-2500/3100/-5420/2000+uk
    	#REGION=-2500/3100/${S}/2000+uk

    gmt begin SouthPole png
    	gmt coast -R$REGION -JA-60/${Lat}/15c -Dl -W -N1 -G245/241/214 -S199/224/246 -Bg10
    gmt end #show

```

---

<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:** [September 3, 2021, 1:00am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/2 "2021-09-03T01:00:34Z")

</div>

I think you are doing it right but GMT may not be. The conversion from your **+uk** to the equivalent **-R** … **.+r** settings in degrees takes place in _gmtinit\_rectR\_to\_geoR_ in gmt\_init.c. You can have a look and see if you notice anything funny for your case. I will have a look later once done with current PR…

---

<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:** [September 3, 2021, 1:36am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/3 "2021-09-03T01:36:14Z")

</div>

Actually, you are using in wrong… Your measure from **mapproject** is the actual length of the curved arc along the meridian on a spherical Earth, whereas the coordinates in **-R…+uk** are distances on a flat projection of the Earth, so it depends on the properties of the projection. If I do things like this:

```
echo 0 -90 | gmt mapproject -Rg -JA-60/-40/25c -C -Fk
3.72772596975e-13	-5385.00930501

```

and use -5385.00930501 then it looks as you expect.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 3, 2021, 1:49am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/4 "2021-09-03T01:49:40Z")

</div>

Thanks. I think -R+uk is more complex than I thought.

---

<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:** [September 3, 2021, 2:15am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/5 "2021-09-03T02:15:29Z")

</div>

Yes, it refers to (flat) map distances, not (spherical/ellipsoidal) Earth distances.

---

<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:** [September 3, 2021, 2:16am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/6 "2021-09-03T02:16:16Z")

</div>

You can check if the documentation is not clear. I think it does say projected distances or similar though.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 3, 2021, 2:17am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/7 "2021-09-03T02:17:06Z")

</div>

So, for example if I want a map to extend 4000 km to the south (from the standard lat and long), how should I do?

---

<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:** [September 3, 2021, 2:33am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/8 "2021-09-03T02:33:29Z")

</div>

If you mean a real Earth distance of 4000 km then you would compute the coordinate of the point that is 4000 km to the south, e.g.

```
echo -60 -40 | gmt vector -Tt180/4000k
-60	-75.9728147105

```

and then get the flat map coordinate of that point for your chosen projection:

```
echo -60 -75.9728147105 | gmt mapproject -Rg -JA-60/-40/1 -C -Fk
0	-3934.62493195

```

and then use that in your -R…+r.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 3, 2021, 2:48am UTC](https://forum.generic-mapping-tools.org/t/map-up-to-the-south-pole-bug-in-r-uk/2053/9 "2021-09-03T02:48:57Z")

</div>

Ok. Thanks. I will need to study a bit it seems.
