Automatic calculation of line orientations in QGIS
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}
I was able to see the types of cables ("* TYPE " in my data table) entered manually and the length of these cables (automatically calculated using the " Slength *" function with the name LONG in the field calculator). this whole info on the same label
("*TYPE||'n'||LONG||'m'*").
It is now impossible to make visible the orientation of the cables (Shape of line type) in gradians (between 0 and 400), with the origin reference in the Eastern direction.
qgis
add a comment
|
I was able to see the types of cables ("* TYPE " in my data table) entered manually and the length of these cables (automatically calculated using the " Slength *" function with the name LONG in the field calculator). this whole info on the same label
("*TYPE||'n'||LONG||'m'*").
It is now impossible to make visible the orientation of the cables (Shape of line type) in gradians (between 0 and 400), with the origin reference in the Eastern direction.
qgis
add a comment
|
I was able to see the types of cables ("* TYPE " in my data table) entered manually and the length of these cables (automatically calculated using the " Slength *" function with the name LONG in the field calculator). this whole info on the same label
("*TYPE||'n'||LONG||'m'*").
It is now impossible to make visible the orientation of the cables (Shape of line type) in gradians (between 0 and 400), with the origin reference in the Eastern direction.
qgis
I was able to see the types of cables ("* TYPE " in my data table) entered manually and the length of these cables (automatically calculated using the " Slength *" function with the name LONG in the field calculator). this whole info on the same label
("*TYPE||'n'||LONG||'m'*").
It is now impossible to make visible the orientation of the cables (Shape of line type) in gradians (between 0 and 400), with the origin reference in the Eastern direction.
qgis
qgis
edited May 27 at 12:44
Mat
1,1311 gold badge6 silver badges17 bronze badges
1,1311 gold badge6 silver badges17 bronze badges
asked May 27 at 10:24
Gil MirandaGil Miranda
133 bronze badges
133 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
To get line angle you can use field calculator depending what exactly you need:
- line_interpolate_angle(geometry,distance)
- angle_at_vertex(geometry,vertex)
For more details check help in field calculator:
Result is in degrees (north origin), to convert it in grads you need to multiply by (400/360).
So field calculator expression would be something like: line_interpolate_angle($geometry,0) * (400 / 360)
.
Since you need angle originating from east you will need to add 90°: (line_interpolate_angle($geometry,0)+90 )* (400 / 360)
and substract 400 for features that have value above 400g.
I'll have to do some ajusts but it was really helpfull. Thx
– Gil Miranda
May 27 at 12:57
add a comment
|
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f324024%2fautomatic-calculation-of-line-orientations-in-qgis%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
To get line angle you can use field calculator depending what exactly you need:
- line_interpolate_angle(geometry,distance)
- angle_at_vertex(geometry,vertex)
For more details check help in field calculator:
Result is in degrees (north origin), to convert it in grads you need to multiply by (400/360).
So field calculator expression would be something like: line_interpolate_angle($geometry,0) * (400 / 360)
.
Since you need angle originating from east you will need to add 90°: (line_interpolate_angle($geometry,0)+90 )* (400 / 360)
and substract 400 for features that have value above 400g.
I'll have to do some ajusts but it was really helpfull. Thx
– Gil Miranda
May 27 at 12:57
add a comment
|
To get line angle you can use field calculator depending what exactly you need:
- line_interpolate_angle(geometry,distance)
- angle_at_vertex(geometry,vertex)
For more details check help in field calculator:
Result is in degrees (north origin), to convert it in grads you need to multiply by (400/360).
So field calculator expression would be something like: line_interpolate_angle($geometry,0) * (400 / 360)
.
Since you need angle originating from east you will need to add 90°: (line_interpolate_angle($geometry,0)+90 )* (400 / 360)
and substract 400 for features that have value above 400g.
I'll have to do some ajusts but it was really helpfull. Thx
– Gil Miranda
May 27 at 12:57
add a comment
|
To get line angle you can use field calculator depending what exactly you need:
- line_interpolate_angle(geometry,distance)
- angle_at_vertex(geometry,vertex)
For more details check help in field calculator:
Result is in degrees (north origin), to convert it in grads you need to multiply by (400/360).
So field calculator expression would be something like: line_interpolate_angle($geometry,0) * (400 / 360)
.
Since you need angle originating from east you will need to add 90°: (line_interpolate_angle($geometry,0)+90 )* (400 / 360)
and substract 400 for features that have value above 400g.
To get line angle you can use field calculator depending what exactly you need:
- line_interpolate_angle(geometry,distance)
- angle_at_vertex(geometry,vertex)
For more details check help in field calculator:
Result is in degrees (north origin), to convert it in grads you need to multiply by (400/360).
So field calculator expression would be something like: line_interpolate_angle($geometry,0) * (400 / 360)
.
Since you need angle originating from east you will need to add 90°: (line_interpolate_angle($geometry,0)+90 )* (400 / 360)
and substract 400 for features that have value above 400g.
edited May 27 at 11:27
answered May 27 at 11:19
MatMat
1,1311 gold badge6 silver badges17 bronze badges
1,1311 gold badge6 silver badges17 bronze badges
I'll have to do some ajusts but it was really helpfull. Thx
– Gil Miranda
May 27 at 12:57
add a comment
|
I'll have to do some ajusts but it was really helpfull. Thx
– Gil Miranda
May 27 at 12:57
I'll have to do some ajusts but it was really helpfull. Thx
– Gil Miranda
May 27 at 12:57
I'll have to do some ajusts but it was really helpfull. Thx
– Gil Miranda
May 27 at 12:57
add a comment
|
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f324024%2fautomatic-calculation-of-line-orientations-in-qgis%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown