Geographic Information Systems Asked by Malibu JJ on November 6, 2020
I need to replicate a *.qgs
-file that has 4 different layers as shown in the picture below:
The layer that I am currently trying to replicate is the "links" layer. The information of the layer property is as below:
The attribute table of this layer looks like this:
The csv file, which is the source of the layer in question, looks exactly the same with the exception of the last two columns.
I was able to display the layer visualization using the "Points to Path", that comes from the "Processing Toolbox". However, I don’t get the same attribute table as shown previously. In addition, it is not that straightforward as I had to manipulate the csv files beforehand.
I created a "To_From"
column and created one csv file for "To_From"
filled with "to"
and one csv file for "To_From"
filled with "from"
. After that, I add both files using "Add>Add Layer>Add Delimited Text Layer". Subsequently, I merge the layers and create a column "order"
with 0 for "to"
and 1 for "from"
. Only after this, I am able to use the "Points to Path".
I wonder if there is an alternative way for my current approach in which I am able to get the attribute table attached previously…
I am using QGIS 3.10.5-A Coruña.
I'm not sure whethter I understand your question correctly! But I would try something like the following steps:
Good luck!
Answered by oekoplaner on November 6, 2020
Put eye on the following workflow
Drag&Drop your .csv
-file with attributes into QGIS
Deploy a Virtual Layer through Layer > Add Layer > Add/Edit Virtual Layer...
to obtain a layer with geometry, i.e. flows.
SELECT *, setsrid(
make_line(
make_point("X_From","Y_From"),
make_point("X_To","Y_To")
),
#here use your SRID, e.g. 25833
)
FROM "test"
Get the Output
Answered by Taras on November 6, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP