Skip to content

Commit a71ba5b

Browse files
committed
Merge branch 'master' into psconvert-no-file-dup
2 parents a812460 + e53628a commit a71ba5b

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ jobs:
173173
if: failure()
174174

175175
- name: Upload coverage to Codecov
176-
uses: codecov/codecov-action@v5.4.0
176+
uses: codecov/codecov-action@v5.4.2
177177
env:
178178
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
179179
with:

doc/rst/source/plot.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ Optional Arguments
305305
.. _-W:
306306

307307
**-W**\ [*pen*][*attr*] :ref:`(more ...) <-Wpen_attrib>`
308-
Set pen attributes for lines or the outline of symbols [Defaults:
308+
Set pen attributes for lines or the outline of symbols or polygons [Defaults:
309309
*width* = 0.25p, *color* = black, *style* = solid]. Modifiers can be used to change the
310310
appearance of the line:
311311

doc/rst/source/reference/features.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -1761,18 +1761,18 @@ Placing a feature on the map means selecting a *reference* point somewhere on th
17611761
It may be helpful to consider the analog of a boat dropping an anchor: The boat navigates to the
17621762
reference point and then, depending on where on the boat the anchor is located, moves so that the
17631763
anchor connection point overlies the reference point, then drops the anchor.
1764-
There are four different ways to specify the reference point on a map, allowing for complete freedom
1764+
There are five different ways to specify the reference point on a map, allowing for complete freedom
17651765
to select any location inside or outside the map. The reference point syntax is [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*;
17661766
the five codes **g**\|\ **j**\|\ **J**\|\ **n**\|\ **x** refer to the five ways:
17671767

1768-
.. _Reference_Points_g:
1768+
.. _Reference_Points_g:
17691769

17701770
#. [**g**] Specify *refpoint* using *data* coordinates, e.g., the longitude and latitude of the reference point.
17711771
This mechanism is useful when you want to tie the location of the feature to an actual point
17721772
best described by data coordinates. An example of such a reference point might
17731773
be **g**\ 135W/20N.
17741774

1775-
.. _Reference_Points_j:
1775+
.. _Reference_Points_j:
17761776

17771777
#. [**j**] Specify *refpoint* using one of the nine *justification codes*, equivalent to the justification
17781778
codes for placing text strings in :doc:`/text`. This mechanism is illustrated in the figure above and
@@ -1786,14 +1786,14 @@ the five codes **g**\|\ **j**\|\ **J**\|\ **n**\|\ **x** refer to the five ways:
17861786
justification code. Thus, when using **JTL**\, the anchor point on the map feature will default to **BR**.
17871787
This is practical for features that are drawn **outside** of the basemap (like color bars often are).
17881788

1789-
.. _Reference_Points_x:
1789+
.. _Reference_Points_x:
17901790

17911791
#. [**x**] Specify *refpoint* using *plot* coordinates, i.e., the distances in inches, centimeters, or
17921792
points from the lower left plot origin. This mechanism is preferred when you wish to lay out
17931793
map features using familiar measurements of distance from origins. An example of such a reference
17941794
point might be **x**\ 2.75i/2c.
17951795

1796-
.. _Reference_Points_n:
1796+
.. _Reference_Points_n:
17971797

17981798
#. [**n**] Specify *refpoint* using *normalized* coordinates, i.e., fractional coordinates between 0
17991799
and 1 in both the *x* and *y* directions. This mechanism avoids units and is useful if you want to always

src/gmt_support.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -11348,8 +11348,8 @@ struct GMT_DATASET *gmt_make_profiles (struct GMT_CTRL *GMT, char option, char *
1134811348

1134911349
/* step is given in either Cartesian units or, for geographic, in the prevailing unit (m, km) */
1135011350

11351-
if (strstr (args, "+c")) continuous = true; /* Want to add distances to the output */
11352-
if (strstr (args, "+d")) get_distances = true; /* Want to join abutting profiles */
11351+
if (strstr (args, "+c")) continuous = true; /* Want to join abutting profiles */
11352+
if (strstr (args, "+d")) get_distances = true; /* Want to add distances to the output */
1135311353
if (strstr (args, "+g")) gridline_units = true; /* Want degree longitudes or latitudes along a gridline */
1135411354
if (strstr (args, "+p")) parallel = true; /* Want to sample along a parallel */
1135511355
if (strstr (args, "+x")) GMT->current.map.loxodrome = true; /* Want to sample along a rhumbline */
@@ -11543,8 +11543,10 @@ struct GMT_DATASET *gmt_make_profiles (struct GMT_CTRL *GMT, char option, char *
1154311543
else { /* Copy over but avoid repeating the joint */
1154411544
gmt_M_memcpy (&(prev_S->data[GMT_X][start]), &(S->data[GMT_X][1]), add, double);
1154511545
gmt_M_memcpy (&(prev_S->data[GMT_Y][start]), &(S->data[GMT_Y][1]), add, double);
11546-
gmt_M_memcpy (&(prev_S->data[GMT_Z][start]), &(S->data[GMT_Z][1]), add, double);
11547-
for (rec = start; rec < prev_S->n_rows; rec++) prev_S->data[GMT_Z][rec] += prev_S->data[GMT_Z][start-1];
11546+
if(get_distances){
11547+
gmt_M_memcpy (&(prev_S->data[GMT_Z][start]), &(S->data[GMT_Z][1]), add, double);
11548+
for (rec = start; rec < prev_S->n_rows; rec++) prev_S->data[GMT_Z][rec] += prev_S->data[GMT_Z][start-1];
11549+
}
1154811550
gmt_free_segment (GMT, &S); /* Done with this guy */
1154911551
S = prev_S;
1155011552
}

src/project.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,14 @@ EXTERN_MSC int GMT_project (void *V_API, int mode, void *args) {
844844
gmt_set_column_type (GMT, GMT_OUT, GMT_X, (Ctrl->N.active) ? GMT_IS_FLOAT : GMT_IS_LON);
845845
gmt_set_column_type (GMT, GMT_OUT, GMT_Y, (Ctrl->N.active) ? GMT_IS_FLOAT : GMT_IS_LAT);
846846
gmt_set_column_type (GMT, GMT_OUT, GMT_Z, GMT_IS_FLOAT);
847-
if (Ctrl->Q.active && Ctrl->G.unit != 'k' && !Ctrl->G.number)
848-
Ctrl->G.inc *= 0.001 / GMT->current.map.dist[GMT_MAP_DIST].scale; /* Now in km */
847+
if (Ctrl->Q.active && Ctrl->G.unit != 'k' && !Ctrl->G.number){
848+
if (GMT->current.map.dist[GMT_MAP_DIST].arc) {
849+
Ctrl->G.inc *= (GMT->current.proj.KM_PR_DEG / GMT->current.map.dist[GMT_MAP_DIST].scale); /* Now in km */
850+
}
851+
else {
852+
Ctrl->G.inc /= METERS_IN_A_KM * GMT->current.map.dist[GMT_MAP_DIST].scale; /* Now in km */
853+
}
854+
}
849855
}
850856
else if (!Ctrl->N.active) { /* Decode and set the various output column types in the geographic case */
851857
for (col = 0; col < P.n_outputs; col++) {

0 commit comments

Comments
 (0)