# Finding the rectangular domain that covers an oblique area

**URL:** <https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872>\
**Category:** Q&A\
**Created:** [May 4, 2022, 10:06am UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872 "2022-05-04T10:06:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [May 4, 2022, 10:06am UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872/1 "2022-05-04T10:06:25Z")

</div>

My script looks like this (1st figure):

```
gmt pscoast -Bafg -JS36/90/30c -R-15/60/68/90 -Ggray -png pie

```

I would like to make this a rectangular map instead, i.e. I have to provide a `-Rw/s/e/n+r`. To obtain this I do:

```
$ gmt mapproject -JS36/90/30c -R-15/60/68/90 -Wn0/0
-1.85242110467 62.3326996594

$ gmt mapproject -JS36/90/30c -R-15/60/68/90 -Wn1/1
126 80.9626773189

```

and use this in `-R` (2nd figure):

```
gmt pscoast -Bafg -JS36/90/30c -R-1.85242110467/62.3326996594/126/80.9626773189+r -Ggray -png rectangular

```

Reading about [mapproject -Wr/R](https://docs.generic-mapping-tools.org/dev/mapproject.html#w):

```
To output the rectangular domain that covers an oblique area as defined
by -R -J, append r, or use R to get the result in -Rw/e/s/n string format.

```

I was hoping that this would give me the wanted `-R`:

```
$ gmt mapproject -JS36/90/30c -R-15/60/68/90 -WR
-R-15/60/68/90

```

But obviously this just gives me the input `-R`. I don’t understand when `mapproject -Wr/R` would give valuable information. Am I misunderstanding the description of `mapproject -Wr/R`?

Is there any way of getting `-R-1.85242110467/62.3326996594/126/80.9626773189+r` out of `mapproject` given `-JS36/90/30c -R-15/60/68/90`?

 ![pie](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/2/211069221053163b5a70616c8e81cb3b9099364f.png) ![rectangular](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/3/3ce1ac6811de1331554e57c0a19b883f6e2e8257.png)

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [May 4, 2022, 6:28pm UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872/2 "2022-05-04T18:28:20Z")

</div>

> [@Andreas](#):
>
> `the rectangular domain that covers an oblique area`

it says “oblique”, that is, oblique Mercator, not stereographic. you are specifying JS… = stereographic.

But thanks anyway, personally I liked the question.

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [May 4, 2022, 9:15pm UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872/3 "2022-05-04T21:15:18Z")

</div>

Why mercator?

In [gmt.conf](https://docs.generic-mapping-tools.org/dev/gmt.conf.html#term-MAP_ANNOT_OBLIQUE) _oblique_ is defined as

```
This setting applies to “oblique” projections, which in this context means
maps whose boundary is a rectangle not specified by meridians and parallels
```

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [May 4, 2022, 9:36pm UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872/4 "2022-05-04T21:36:21Z")

</div>

yet another context I believe

while the examples on the `mapproject`'s manual page explicitly use oblique Mercator projection

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [May 4, 2022, 9:38pm UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872/5 "2022-05-04T21:38:44Z")

</div>

Yes. Thanks. I’ll have a closer look at the docs. Can’t understand why this is so confusing to me.

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [May 4, 2022, 10:24pm UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872/6 "2022-05-04T22:24:07Z")

</div>

what I wrote was probably totally wrong.

you wrote:  
I would like to make this a rectangular map instead, i.e. I have to provide a `-Rw/s/e/n+r`.

`mapproject`'s option `-WR` gives `-Rw/e/s/n`. This is rectangular _but not oblique_, so it returns a copy of your `-R-15/60/68/90`.

Note the difference: you want `-Rw/s/e/n+r` while `-WR` gives `-Rw/e/s/n`. `-WR` does not do what you want.

---

<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:** [May 6, 2022, 8:48pm UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872/7 "2022-05-06T20:48:51Z")

</div>

See new documentation and illustration for **-W** in **mapproject** at the [dev version](https://docs.generic-mapping-tools.org/dev/mapproject.html) documentation.

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [May 9, 2022, 11:45am UTC](https://forum.generic-mapping-tools.org/t/finding-the-rectangular-domain-that-covers-an-oblique-area/2872/8 "2022-05-09T11:45:24Z")

</div>

As Paul wrote, this is now implemented. And I can do this:

```auto
gmt mapproject -JS36/90/30c -R-15/60/68/90 -WE
-R-1.852421104674526/62.33269965938534/126/80.96267731894207+r

```

which answers my question. Slick.
