Repository navigation
Description
When using gridded data in non-cartesian projections with rectangular borders I run into some problems when selecting the region of interest. The current mechanism is to specify lower left and upper right corner of the region of interest when using -R...r. This creates some difficulties in higher latitudes when using it with projections like Lambert conic conformal -JL as illustrated in this crude mockup:
Explanation:
- the green stars are the lower left and upper richt corner as given in
-R...r - the blue outline is the (crude) representation of the projection
-JLwith the blue dashed lines representing the center of the projection - the black frame is the plotted area
- the red fill shows areas without gridded data if same -R...r is used for
select/grdimage/etc
Problems:
- it is hard to get a plot centered on the projection center
- it usually requires several iterations to get a region definition large enough to fill the plot area with gridded data. Not very convenient with large files.
Feature request, open for debate:
- add a behavior similar to
-Rwithoutrwhere one specifies the northern and southern most latitudes and can use one of the following longitude specifications:- longitudes at mid-latitude taken from projection center in
-J, proposed-R...rmfor mid (see example 1 below) - max longitudes on plot, only a point in the corner, proposed
-R...rxfor max (see example 2 below) - min longitudes visible visible on longest latitude on plot, there are some more but these must be on the plot, proposed
-R...rnfor min (see example 3 below)
- longitudes at mid-latitude taken from projection center in
- have GMT calculate the parameters for the "expanded" projection in the background for use with
select/grdimage/etc to cover the red areas.
Example 1:

The longitudes are referenced to the latitude of the projection center.
Example 2:

The longitudes are the min longitudes to be present on the plot.
Example 3:

The longitudes are the max longitudes displayed on the longest line of latitude.
In all cases the parameters for the "expanded" projection are calculated in the background.
While making this feature request it came to my mind that this could be seen as two different requests. One for the different ways to define the region and one for the calculation of the expanded projection parameters in the background. Please advise if I should split them.

Activity
anbj commentedon Apr 14, 2020
This is a great suggestion, and I will vouch for it. My experience is the same;
-R...ris often painful to do and requires several iterations, as said above. I think I asked about something similar some time ago, but I cant find the link.PaulWessel commentedon Apr 14, 2020
I find it way easier to specify the region in, say, km relative to the desired projection center, e.g.,
-R-1500/1500/-1000/1000+ukIsn't that a simpler mechanism?
gmt basemap -R-1500/1500/-1000/1000+uk -JL45/35/25/45/6i -Bafg -pdf mapKristofKoch commentedon Apr 14, 2020
@PaulWessel I must admit I haven't thought of this possibility. Let me toy around with it a bit and I'll report back.
anbj commentedon Apr 15, 2020
Paul, if I would like to make a map created with
to be rectangular, what would be the best way? Is it possible with the method you mentioned above?
What about having an option to say to GMT, "make the map with given
-Rand put it in a rectangular box" (see figure, sorry for the quality):Sorry to hijack the thread @KristofKoch (hope it's OK). I think we want the same thing.
KristofKoch commentedon Apr 15, 2020
I found the recommendation by @PaulWessel to specify the distances from projection center quite useful but it doesn't always fit my bill if I have to fit some fixes in the extreme corners onto the plot. Then it is back to trial and error. There the idea of @anbj comes in very handy (thank you for your input) and is even simpler than my ideas presented in the original post.
Is there a way of tweaking the projection parameters to get a plot with specified dimensions when using Pauls idea? Width is no problem but height is. Say I want to fit a map on a page of DIN A4 paper (210 mm x 297 mm). I was able to achieve this with the current -R...r behavior by calculating the upper right coordinate. Am I missing something?
Additionally I found the
@earth_relief_grids to behave differently when comparing@earth_relief_01sand@earth_relief_03sto the rest. 01s and 03s behave like-JL... -R...rwith missing data on western and northern edges while all other detail levels plot the data right up to the edge.anbj commentedon May 30, 2020
Any news about this?
stale commentedon Aug 29, 2020
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.
anbj commentedon Oct 20, 2020
Ping?
stale commentedon Jan 19, 2021
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.
anbj commentedon Sep 6, 2021
This is a better example of what I meant, this time made with professional software.
Enter normal
-Rand get your pie slice. Append e.g.fand makegmtfill in the blanks so you get a square/rectangular map.anbj commentedon Jan 19, 2022
Ping
maxrjones commentedon Mar 24, 2022
Following up from #6474 (comment), do you think an example of that mapproject use-case in the new gmt-examples site would be sufficient for this issue?
anbj commentedon Mar 24, 2022
For me, yes, to a very large degree. But I can't answer on behalf of @KristofKoch!
anbj commentedon May 9, 2022
Just for reference; what I wanted was implemented in #6669.
PaulWessel commentedon Jul 21, 2023
@KristofKoch and @anbj , please revisit and see if #7657 provides a workable solution to some of these.