Discussion:
Arbitrary rotation of symbols?
Eric Patton
2014-07-17 15:30:19 UTC
Permalink
I have generated a shapefile of glacial lineations using a GIS, and have
successfully converted the line shapefile to GMT format using OGR. The
lineations plot fine in GMT.

These features are similar to vectors, in the sense that they illustrate
direction of flow, but they are different in that they are not described by a
length and azimuth as vectors are using -Sv; they curved lines. I want to show
the direction of flow by placing a triangle at the last x,y coordinate in the
line segment, but is it possible to rotate a triangle symbol so that the
triangle head is oriented correctly with respect to the trend of the line?

This is basically the same issue described in
https://listserv.hawaii.edu/cgi-bin/wa?A2=ind0801&L=GMT-HELP&P=R52411&1=GMT-HELP&9=A&I=-3&J=on&d=No+Match%3BMatch%3BMatches&z=4

but I'm not sure if the functionality has been added in the intervening 6
years. The psxy manual doesn't seem to indicate that there is, but I thought I
would ask anyway.

Thanks,
--
Eric Patton

Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Joaquim Luis
2014-07-17 15:37:54 UTC
Permalink
We have curved vectors now on 5 (don't remember the details without
consulting the manual). See for example

Loading Image...
Post by Eric Patton
I have generated a shapefile of glacial lineations using a GIS, and have
successfully converted the line shapefile to GMT format using OGR. The
lineations plot fine in GMT.
These features are similar to vectors, in the sense that they illustrate
direction of flow, but they are different in that they are not described by a
length and azimuth as vectors are using -Sv; they curved lines. I want to show
the direction of flow by placing a triangle at the last x,y coordinate in the
line segment, but is it possible to rotate a triangle symbol so that the
triangle head is oriented correctly with respect to the trend of the line?
This is basically the same issue described in
https://listserv.hawaii.edu/cgi-bin/wa?A2=ind0801&L=GMT-HELP&P=R52411&1=GMT-HELP&9=A&I=-3&J=on&d=No+Match%3BMatch%3BMatches&z=4
but I'm not sure if the functionality has been added in the intervening 6
years. The psxy manual doesn't seem to indicate that there is, but I thought I
would ask anyway.
Thanks,
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Eric Patton
2014-07-17 15:50:21 UTC
Permalink
Thanks, but I was asking if it is possible to rotate a triangle symbol in
psxy, or by some other method. The paths for my vectors have already been
digitized by hand. I want insert rotated arrowheads at their endpoints.

~ Eric.
Post by Joaquim Luis
We have curved vectors now on 5 (don't remember the details without
consulting the manual). See for example
http://gmt.soest.hawaii.edu/doc/5.1.1/_images/example_30.png
Post by Eric Patton
I have generated a shapefile of glacial lineations using a GIS, and have
successfully converted the line shapefile to GMT format using OGR. The
lineations plot fine in GMT.
These features are similar to vectors, in the sense that they illustrate
direction of flow, but they are different in that they are not described by a
length and azimuth as vectors are using -Sv; they curved lines. I want to show
the direction of flow by placing a triangle at the last x,y coordinate in the
line segment, but is it possible to rotate a triangle symbol so that the
triangle head is oriented correctly with respect to the trend of the line?
This is basically the same issue described in
https://listserv.hawaii.edu/cgi-bin/wa?A2=ind0801&L=GMT-HELP&P=R52411&1=GMT-HELP&9=A&I=-3&J=on&d=No+Match%3BMatch%3BMatches&z=4
but I'm not sure if the functionality has been added in the intervening 6
years. The psxy manual doesn't seem to indicate that there is, but I thought I
would ask anyway.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Joaquim Luis
2014-07-17 16:05:13 UTC
Permalink
You can rotate rectangles but afaik that's the only symbol you can
rotate. For other cases I'm afraid you'll have to create a custom symbol.

But I still don't get it. At the end isn't something of this kind that
you want?

http://gmt.soest.hawaii.edu/projects/gmt/repository/changes/trunk/test/psxy/geovector.ps

so you can put a geovector at the end of your digitized line, no?
Post by Eric Patton
Thanks, but I was asking if it is possible to rotate a triangle symbol in
psxy, or by some other method. The paths for my vectors have already been
digitized by hand. I want insert rotated arrowheads at their endpoints.
~ Eric.
Post by Joaquim Luis
We have curved vectors now on 5 (don't remember the details without
consulting the manual). See for example
http://gmt.soest.hawaii.edu/doc/5.1.1/_images/example_30.png
Post by Eric Patton
I have generated a shapefile of glacial lineations using a GIS, and have
successfully converted the line shapefile to GMT format using OGR. The
lineations plot fine in GMT.
These features are similar to vectors, in the sense that they illustrate
direction of flow, but they are different in that they are not described by a
length and azimuth as vectors are using -Sv; they curved lines. I want to show
the direction of flow by placing a triangle at the last x,y coordinate in the
line segment, but is it possible to rotate a triangle symbol so that the
triangle head is oriented correctly with respect to the trend of the line?
This is basically the same issue described in
https://listserv.hawaii.edu/cgi-bin/wa?A2=ind0801&L=GMT-HELP&P=R52411&1=GMT-HELP&9=A&I=-3&J=on&d=No+Match%3BMatch%3BMatches&z=4
but I'm not sure if the functionality has been added in the intervening 6
years. The psxy manual doesn't seem to indicate that there is, but I thought I
would ask anyway.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Eric Patton
2014-07-17 16:30:53 UTC
Permalink
Post by Joaquim Luis
You can rotate rectangles but afaik that's the only symbol you can
rotate. For other cases I'm afraid you'll have to create a custom symbol.
But I still don't get it. At the end isn't something of this kind
that you want?
Yes, those would be ideal, if I knew how to how to generate them. But I am
lacking both the azimuth and length for each line segment; they are unknown.
And each line segment is composed of several xy vertices - would that be a
problem?

~ Eric.

Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Joaquim Luis
2014-07-17 16:42:07 UTC
Permalink
Post by Eric Patton
Post by Joaquim Luis
You can rotate rectangles but afaik that's the only symbol you can
rotate. For other cases I'm afraid you'll have to create a custom symbol.
But I still don't get it. At the end isn't something of this kind
that you want?
Yes, those would be ideal, if I knew how to how to generate them. But I am
lacking both the azimuth and length for each line segment; they are unknown.
And each line segment is composed of several xy vertices - would that be a
problem?
At least in a first approximation you only need the the length and
azimuth of the digitized line last segment (better if it's not too
short) and you can compute them with mapproject -G and -Af options. The
insertion point of the geovector would than be at the before last vertex
of your polyline.

Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Eric Patton
2014-07-17 18:10:55 UTC
Permalink
Post by Joaquim Luis
At least in a first approximation you only need the the length and
azimuth of the digitized line last segment (better if it's not too
short) and you can compute them with mapproject -G and -Af options.
The insertion point of the geovector would than be at the before last
vertex of your polyline.
Thanks for the hint about mapproject; I've genrated a file with
x,y,azimuth,distance (in metres).

Here's the command I used in psxy:

psxy Onshore_Lineations.gmt -J -R -B -O -K -S=7+e+golivedrab3 -W >> map.ps

I ran into a malloc error, though:

ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/gmt-5.1.1/bin/../lib/x86_64-linux-gnu/libgmt.so.5(gmt_circle_pen_poly+0x239)[0x7f7831e59de9]
[0x0]
*** Error in `psxy': malloc(): memory corruption: 0x0000000000e05a60 ***

I've attached the goevectors file that caused the crash. Should I file a bug report?

~ Eric.

Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Joaquim Luis
2014-07-17 20:14:58 UTC
Permalink
It doesn't crash here (but I'm using 5.2dev version) and needed to use
the -S=...+n modifier, otherwise no heads on your (short) vectors.

psxy Onshore_Lineations.gmt -JX14d -R-118/-102/68/74 -Ba -S=1c+je+e+n -P
-Gred --MAP_VECTOR_SHAPE=1 > lixo.ps


note also that the +s says one can ...

*+s* means the input /angle/, /length/ is instead the /x/, /y/
coordinates of the vector end point.
Post by Eric Patton
Thanks for the hint about mapproject; I've genrated a file with
x,y,azimuth,distance (in metres).
psxy Onshore_Lineations.gmt -J -R -B -O -K -S=7+e+golivedrab3 -W>> map.ps
ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/gmt-5.1.1/bin/../lib/x86_64-linux-gnu/libgmt.so.5(gmt_circle_pen_poly+0x239)[0x7f7831e59de9]
[0x0]
*** Error in `psxy': malloc(): memory corruption: 0x0000000000e05a60 ***
I've attached the goevectors file that caused the crash. Should I file a bug report?
~ Eric.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Paul Wessel
2014-07-17 20:37:00 UTC
Permalink
Crashes for me in trunk because you are passing NaN as the angle. I guess we should skip those records with a warning.
-p
It doesn't crash here (but I'm using 5.2dev version) and needed to use the -S=...+n modifier, otherwise no heads on your (short) vectors.
psxy Onshore_Lineations.gmt -JX14d -R-118/-102/68/74 -Ba -S=1c+je+e+n -P -Gred --MAP_VECTOR_SHAPE=1 > lixo.ps
note also that the +s says one can ...
+s means the input angle, length is instead the x, y coordinates of the vector end point.
Post by Eric Patton
Thanks for the hint about mapproject; I've genrated a file with
x,y,azimuth,distance (in metres).
psxy Onshore_Lineations.gmt -J -R -B -O -K -S=7+e+golivedrab3 -W >> map.ps
ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/gmt-5.1.1/bin/../lib/x86_64-linux-gnu/libgmt.so.5(gmt_circle_pen_poly+0x239)[0x7f7831e59de9]
[0x0]
*** Error in `psxy': malloc(): memory corruption: 0x0000000000e05a60 ***
I've attached the goevectors file that caused the crash. Should I file a bug report?
~ Eric.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Paul Wessel
2014-07-17 21:00:59 UTC
Permalink
I've added more protection against any NaNs present in the non-x/y arguments given to various symbols in psxy and psxyz. Such points are skipped with a warning.
In r13362.

Paul
Post by Paul Wessel
Crashes for me in trunk because you are passing NaN as the angle. I guess we should skip those records with a warning.
-p
It doesn't crash here (but I'm using 5.2dev version) and needed to use the -S=...+n modifier, otherwise no heads on your (short) vectors.
psxy Onshore_Lineations.gmt -JX14d -R-118/-102/68/74 -Ba -S=1c+je+e+n -P -Gred --MAP_VECTOR_SHAPE=1 > lixo.ps
note also that the +s says one can ...
+s means the input angle, length is instead the x, y coordinates of the vector end point.
Post by Eric Patton
Thanks for the hint about mapproject; I've genrated a file with
x,y,azimuth,distance (in metres).
psxy Onshore_Lineations.gmt -J -R -B -O -K -S=7+e+golivedrab3 -W >> map.ps
ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/gmt-5.1.1/bin/../lib/x86_64-linux-gnu/libgmt.so.5(gmt_circle_pen_poly+0x239)[0x7f7831e59de9]
[0x0]
*** Error in `psxy': malloc(): memory corruption: 0x0000000000e05a60 ***
I've attached the goevectors file that caused the crash. Should I file a bug report?
~ Eric.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on
gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on
gmt.soest.hawaii.edu
instead.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Continue reading on narkive:
Loading...