From 02037a3f908ef47752ea06e790ef71d98b83956b Mon Sep 17 00:00:00 2001 From: Joaquim Date: Tue, 4 Jul 2023 16:40:30 +0100 Subject: [PATCH 1/2] Document the -R+U option in the global -R Fix #7537 --- doc/rst/source/explain_-R.rst_ | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/rst/source/explain_-R.rst_ b/doc/rst/source/explain_-R.rst_ index 1c252ad0a60..8a0a0521a6b 100644 --- a/doc/rst/source/explain_-R.rst_ +++ b/doc/rst/source/explain_-R.rst_ @@ -5,7 +5,7 @@ The **-R** option .. _-R: -**-R**\ *xmin*/*xmax*/*ymin*/*ymax*\ [**+r**][**+u**\ *unit*] +**-R**\ *xmin*/*xmax*/*ymin*/*ymax*\ [**+r**][**+u|U**\ *unit*] Specify the region of interest. |Add_-R| **Description** @@ -17,12 +17,12 @@ The **-R** option defines the map region or data domain of interest. It may be s geographic regions when using map projections where meridians and parallels are rectilinear, where *xmin*, *xmax*, *ymin*, and *ymax* refer to the data limits. -#. **-R**\ *xmin*/*xmax*/*ymin*/*ymax*\ **+u**\ *unit*. Append **+u**\ *unit* to the option 1 to specify a region in +#. **-R**\ *xmin*/*xmax*/*ymin*/*ymax*\ **+u|U**\ *unit*. Append **+u**\ *unit* to the option 1 to specify a region in projected units (e.g., UTM meters) where *xmin*/*xmax*/*ymin*/*ymax* are Cartesian projected coordinates compatible with the chosen projection and *unit* is an allowable :ref:`distance unit ` [e]. The coordinates are relative - to the standard longitude and latitude indicated in the projection (**-J**). For projected regions centered on + to the standard longitude and latitude indicated in the projection (**-J**). For projected regions centered on (0,0) you may use the short-hand **-R**\ *halfwidth*\ [/*halfheight*]\ **+u**\ *unit*, where *halfheight* defaults - to *halfwidth* if not given. This short-hand requires the **+u** modifier. + to *halfwidth* if not given. This short-hand requires the **+u** modifier. For convenience, we also support the inverse translation, i.e., +Uunit. This modifier can be used to convert your grid coordinates from meters to the specified unit. #. **-R**\ *xlleft*/*ylleft*/*xuright*/*yuright*\ **+r**. This form is useful for map projections that are oblique, making meridians and parallels poor choices for map boundaries. Here, we instead specify the lower left corner and From 6b496e55b8afc8cca79e8575a47de04dd9f3726f Mon Sep 17 00:00:00 2001 From: Joaquim Date: Thu, 6 Jul 2023 00:02:44 +0100 Subject: [PATCH 2/2] Change x coord to make the second test pass again. --- test/mapproject/proj4.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mapproject/proj4.sh b/test/mapproject/proj4.sh index 0d1fc5ac970..dddc96d03bd 100755 --- a/test/mapproject/proj4.sh +++ b/test/mapproject/proj4.sh @@ -6,7 +6,7 @@ rm -f results.txt echo 4.897 52.371 > pt.txt gmt mapproject pt.txt -J+proj=aea+ellps=WGS84+units=m+lat_1=55+lat_2=65 | gmt math -o1 STDIN -C0 334609.583974 SUB -C1 5218502.503686 SUB 0 COL HYPOT 0.01 GT = >> results.txt -gmt mapproject pt.txt -J+proj=cass+ellps=WGS84+units=m | gmt math -o1 STDIN -C0 333274.431072 SUB -C1 5815921.803069 SUB 0 COL HYPOT 0.01 GT = >> results.txt +gmt mapproject pt.txt -J+proj=cass+ellps=WGS84+units=m | gmt math -o1 STDIN -C0 333273.991537 SUB -C1 5815921.803069 SUB 0 COL HYPOT 0.01 GT = >> results.txt gmt mapproject pt.txt "-J+proj=cea+ellps=WGS84+units=m+lon_0=11d32'00E" | gmt math -o1 STDIN -C0 -738753.247401 SUB -C1 5031644.669407 SUB 0 COL HYPOT 0.01 GT = >> results.txt gmt mapproject pt.txt -J+proj=eqdc+ellps=WGS84+units=m+lat_1=60+lat_2=0 | gmt math -o1 STDIN -C0 307874.536263 SUB -C1 5810915.646438 SUB 0 COL HYPOT 0.01 GT = >> results.txt gmt mapproject pt.txt -J+proj=hammer+ellps=WGS84+units=m | gmt math -o1 STDIN -C0 370843.923425 SUB -C1 5630047.232233 SUB 0 COL HYPOT 0.01 GT = >> results.txt