@Joaquim
Sorry for bothering with this again, but I think mapproject'
s -W
option does not respect -je
either.
I am not sure it is supposed to in this situation, but asking usually does not harm.
I tried to use mapproject -Joa.../-Job... -We...
to calculate a rectangle of an oblique area, like it is shown on the figure in mapproject
ās documentation, left panel.
Here I am using the line from the topic, the ends and the calculated midpoint. The midpoint is needed for -Joa/-Job...
specification. Then a rectangle 100 m (0.1 km) wide is specified as the oblique rectangular region around the line. Half-length is also needed for the correct -R...
specification.
For this I am calling mapproject
like below:
gmt mapproject -Job-104.88249997720496/-4.5560000211675495/-104.877/-4.553/3i -R0.69424861297385021/0.100+uk -We+n2 -je
255.112438522 -4.5597859581
255.1234276 -4.55379191313
255.12256147 -4.55221404886
255.111572409 -4.55820808067
255.112438522 -4.5597859581
gmt mapproject -Job-104.88249997720496/-4.5560000211675495/-104.877/-4.553/3i -R0.69424861297385021/0.100+uk -We+n2
255.112438522 -4.5597859581
255.1234276 -4.55379191313
255.12256147 -4.55221404886
255.111572409 -4.55820808067
255.112438522 -4.5597859581
^^^ output, i.e. rectangle coords with and without -je
match. The same is true for the -Joa...
case (not shown). For mapproject -Joa...
I calculated azimuth externally, see more below.
My posting should have probably ended up here, but I could not just stop writing.
Another part of the same problem (I guess) was when I compared azimuth-based equator -Joa... -We+n2
(using separate azimuth calculations mapproject -A... -G...
) vs two-point-based equator -Job... -We+n2
When I used spherical azimuth from mapproject -G... -A...
(without -je
), the rectangles calculated using mapproject -Joa... -We+n2
and mapproject -Job... -We+n2
, matched. Please see Spaghetti 1 listing below.
When I used elliptical azimuth from mapproject -G... -A...
, the resulting rectangles were visibly different. Please see Spaghetti 2 listing below.
Spaghetti 1, spherical mapproject
azimuth, the two oblique rectangles match well:
geod +ellps=WGS84 -F %.17g -f %.17g +lat_1=-4.559 +lon_1=-104.888 +lat_2=-4.553 +lon_2=-104.877 +n_S=2
-4.5590000000000002 -104.88800000000001
-4.5560000211675495 -104.88249997720496
-4.5529999999999999 -104.877
gmt mapproject -G-104.88249997720496/-4.5560000211675495+uk -Af-104.88249997720496/-4.5560000211675495 --FORMAT_FLOAT_OUT=%.17g
-104.877 -4.5529999999999999 61.313245074112395 0.69424861297385021
#gmt mapproject Azimuth is 61.313245074112395, LENGTH_KM is 0.69424861297385021
gmt mapproject -Job-104.88249997720496/-4.5560000211675495/-104.877/-4.553/3i -R0.69424861297385021/0.100+uk -We+n2
255.112438522 -4.5597859581
255.1234276 -4.55379191313
255.12256147 -4.55221404886
255.111572409 -4.55820808067
255.112438522 -4.5597859581
gmt mapproject -Joa-104.88249997720496/-4.5560000211675495/61.313245074112395/3i -R0.69424861297385021/0.100+uk -We+n2
255.112438522 -4.5597859581
255.1234276 -4.55379191307
255.12256147 -4.5522140488
255.111572409 -4.55820808067
255.112438522 -4.5597859581
^^^ the two oblique rectangles match well
Spaghetti 2, the elliptical azimuth using mapproject -G... -A... -je
, the two oblique rectangles at the end do not match:
geod +ellps=WGS84 -F %.17g -f %.17g +lat_1=-4.559 +lon_1=-104.888 +lat_2=-4.553 +lon_2=-104.877 +n_S=2
-4.5590000000000002 -104.88800000000001
-4.5560000211675495 -104.88249997720496
-4.5529999999999999 -104.877
#LON_CENTER is -104.88249997720496, LAT_CENTER is -4.5560000211675495
gmt mapproject -G-104.88249997720496/-4.5560000211675495+uk -Af-104.88249997720496/-4.5560000211675495 --FORMAT_FLOAT_OUT=%.17g -je
mapproject [WARNING]: Your distance mode (Great Circle) differs from your -j option (Geodesic) which takes precedence.
mapproject [WARNING]: Your distance mode (Great Circle) differs from your -j option (Geodesic) which takes precedence.
-104.877 -4.5529999999999999 61.473997783466466 0.69466780265863348
#gmt mapproject Azimuth is 61.473997783466466, LENGTH_KM is 0.69466780265863348
# geod azimuth calculations for comparison
echo -4.5560000211675495 -104.88249997720496 -4.553 -104.877 | geod +ellps=WGS84 -F %.17g -f %.17g -I
61.473997786429415 -118.52643895208958 694.66780272511619
#geod Azimuth is 61.473997786429415, LENGTH_M is 694.66780272511619
gmt mapproject -Job-104.88249997720496/-4.5560000211675495/-104.877/-4.553/3i -R0.69466780265863348/0.100+uk -We+n2
255.112435205 -4.55978776767
255.123430918 -4.55379010348
255.122564788 -4.55221223922
255.111569091 -4.55820989024
255.112435205 -4.55978776767
gmt mapproject -Joa-104.88249997720496/-4.5560000211675495/61.473997783466466/3i -R0.69466780265863348/0.100+uk -We+n2
255.112424564 -4.5597735875
255.123437115 -4.55380669965
255.122575429 -4.55222641921
255.111562895 -4.55819329394
255.112424564 -4.5597735875
^^^ the two oblique rectangles at the end do not match