Connect Points using line different table in QGIS3Error 000725 using Points to LineZ values in kmlLooking for an algorithm to quickly find the closest point on a road network (or other graph)Creating curved lines between two points in QGISHow to connect points to only nearby pointsGroup geotagged photos in MapInfoConnect points and store point info in line attributesCreating points projected on line using QGIS?QGIS points or line vertexCreating line from points in QGIS

Can the Help action be used to give advantage to a specific ally's attack (rather than just the next ally who attacks the target)?

Question about exercise 11.5 in TeXbook

How feasible is the Delta-Glider?

Why does the UK have more political parties than the US?

The Passive Wisdom (Perception) score of my character on D&D Beyond seems too high

Do firearms count as ranged weapons?

Could IPv6 make NAT / port numbers redundant?

How to prevent bad sectors?

1960s sci-fi novella with a character who is treated as invisible by being ignored

How do I subvert the tropes of a train heist?

What are these (utility?) boxes at the side of the house?

Could I be denied entry into Ireland due to medical and police situations during a previous UK visit?

Modern approach to radio buttons

What does it mean when you think without speaking?

Windows 10 Programs start without visual Interface

How were these pictures of spacecraft wind tunnel testing taken?

Why does the 6502 have the BIT instruction?

Future enhancements for the finite element method

Why do Russians call their women expensive ("дорогая")?

What F1 in name of seeds/varieties means?

Can't use numexpr in horizontal mode

What are the problems in teaching guitar via Skype?

What's the connection between "kicking a pigeon" and "how a bill becomes a law"?

The qvolume of an integer



Connect Points using line different table in QGIS3


Error 000725 using Points to LineZ values in kmlLooking for an algorithm to quickly find the closest point on a road network (or other graph)Creating curved lines between two points in QGISHow to connect points to only nearby pointsGroup geotagged photos in MapInfoConnect points and store point info in line attributesCreating points projected on line using QGIS?QGIS points or line vertexCreating line from points in QGIS






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I have two tables.



Table1 is having many point objects (Sample given below)
Table2 shows the connectivity between the point object(using a link) and link details



My requirement is to have a new Line layer connecting point objects from Table1 as per the Link in Table2.



example : I need to have one line connecting A1 to A3 with a name of "A1_A3", another Line connecting A5 to A4 name of the line to be A5_A4)



I tried with few plugins like connectpoints & points2one... But no luck.



Points



Links










share|improve this question









New contributor



Akhilesh jj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • @GIS_Esri: Do you want cross join? or not? describe more plz.

    – Taras
    May 22 at 9:14












  • Have you had a look at connect by lines (search for connect in the tool box)? Feature names may be added afterwards using the field calculator. Could this suit your needs?

    – Erik
    May 22 at 9:25

















2















I have two tables.



Table1 is having many point objects (Sample given below)
Table2 shows the connectivity between the point object(using a link) and link details



My requirement is to have a new Line layer connecting point objects from Table1 as per the Link in Table2.



example : I need to have one line connecting A1 to A3 with a name of "A1_A3", another Line connecting A5 to A4 name of the line to be A5_A4)



I tried with few plugins like connectpoints & points2one... But no luck.



Points



Links










share|improve this question









New contributor



Akhilesh jj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • @GIS_Esri: Do you want cross join? or not? describe more plz.

    – Taras
    May 22 at 9:14












  • Have you had a look at connect by lines (search for connect in the tool box)? Feature names may be added afterwards using the field calculator. Could this suit your needs?

    – Erik
    May 22 at 9:25













2












2








2


1






I have two tables.



Table1 is having many point objects (Sample given below)
Table2 shows the connectivity between the point object(using a link) and link details



My requirement is to have a new Line layer connecting point objects from Table1 as per the Link in Table2.



example : I need to have one line connecting A1 to A3 with a name of "A1_A3", another Line connecting A5 to A4 name of the line to be A5_A4)



I tried with few plugins like connectpoints & points2one... But no luck.



Points



Links










share|improve this question









New contributor



Akhilesh jj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have two tables.



Table1 is having many point objects (Sample given below)
Table2 shows the connectivity between the point object(using a link) and link details



My requirement is to have a new Line layer connecting point objects from Table1 as per the Link in Table2.



example : I need to have one line connecting A1 to A3 with a name of "A1_A3", another Line connecting A5 to A4 name of the line to be A5_A4)



I tried with few plugins like connectpoints & points2one... But no luck.



Points



Links







qgis points-to-line






share|improve this question









New contributor



Akhilesh jj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



Akhilesh jj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited May 22 at 9:07









J. Monticolo

2,153522




2,153522






New contributor



Akhilesh jj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked May 22 at 8:53









Akhilesh jjAkhilesh jj

133




133




New contributor



Akhilesh jj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Akhilesh jj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • @GIS_Esri: Do you want cross join? or not? describe more plz.

    – Taras
    May 22 at 9:14












  • Have you had a look at connect by lines (search for connect in the tool box)? Feature names may be added afterwards using the field calculator. Could this suit your needs?

    – Erik
    May 22 at 9:25

















  • @GIS_Esri: Do you want cross join? or not? describe more plz.

    – Taras
    May 22 at 9:14












  • Have you had a look at connect by lines (search for connect in the tool box)? Feature names may be added afterwards using the field calculator. Could this suit your needs?

    – Erik
    May 22 at 9:25
















@GIS_Esri: Do you want cross join? or not? describe more plz.

– Taras
May 22 at 9:14






@GIS_Esri: Do you want cross join? or not? describe more plz.

– Taras
May 22 at 9:14














Have you had a look at connect by lines (search for connect in the tool box)? Feature names may be added afterwards using the field calculator. Could this suit your needs?

– Erik
May 22 at 9:25





Have you had a look at connect by lines (search for connect in the tool box)? Feature names may be added afterwards using the field calculator. Could this suit your needs?

– Erik
May 22 at 9:25










1 Answer
1






active

oldest

votes


















2














In QGIS, you can create a Virtual layer (Edit Menu > Create Layer > New Virtual Layer) with the code below :



SELECT t3."SI No",
t3."Link ID",
t3."Link Desc",
make_line(ST_GeomFromText(t3.ptfrom), ST_GeomFromText(t3.ptto)) AS geom
FROM (SELECT "Table2"."SI No",
"Table2"."Link ID",
"Table2"."Link Desc",
ST_AsText(t1from.geometry) AS ptfrom,
ST_AsText(t1to.geometry) AS ptto
FROM "Table2"
INNER JOIN "Table1" t1from ON "Table2"."From" = t1from."Object name"
INNER JOIN "Table1" t1to ON "Table2"."To" = t1to."Object name") AS t3


Usually, the SQL query is more simple but here, I've tried to reproduce your case with two memory layers (Table1 point, Table2 no geometry) and I had to transform point geometry into text (WKT) to have both Table1 fields.






share|improve this answer

























  • Does it make any difference to use an alias instead of a nested query?

    – Taras
    May 22 at 10:03











  • you can remove the outer query and build the line directly using the geometries make_line(t1from.geometry,t1to.geometry)

    – JGH
    May 22 at 11:07











  • @JGH : I know, but it doesn't work with my two memory layers. Virtual Layers didn't want to show the two geometry fields from Table1, I don't know why and this is why I translate geom in WKT and reverse operation then.

    – J. Monticolo
    May 22 at 11:16











  • @Taras : are you referring to t3?

    – J. Monticolo
    May 22 at 11:17












  • @J.Monticolo, yes

    – Taras
    May 22 at 11:18











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/3.0/"u003ecc by-sa 3.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
);



);






Akhilesh jj is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f323529%2fconnect-points-using-line-different-table-in-qgis3%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









2














In QGIS, you can create a Virtual layer (Edit Menu > Create Layer > New Virtual Layer) with the code below :



SELECT t3."SI No",
t3."Link ID",
t3."Link Desc",
make_line(ST_GeomFromText(t3.ptfrom), ST_GeomFromText(t3.ptto)) AS geom
FROM (SELECT "Table2"."SI No",
"Table2"."Link ID",
"Table2"."Link Desc",
ST_AsText(t1from.geometry) AS ptfrom,
ST_AsText(t1to.geometry) AS ptto
FROM "Table2"
INNER JOIN "Table1" t1from ON "Table2"."From" = t1from."Object name"
INNER JOIN "Table1" t1to ON "Table2"."To" = t1to."Object name") AS t3


Usually, the SQL query is more simple but here, I've tried to reproduce your case with two memory layers (Table1 point, Table2 no geometry) and I had to transform point geometry into text (WKT) to have both Table1 fields.






share|improve this answer

























  • Does it make any difference to use an alias instead of a nested query?

    – Taras
    May 22 at 10:03











  • you can remove the outer query and build the line directly using the geometries make_line(t1from.geometry,t1to.geometry)

    – JGH
    May 22 at 11:07











  • @JGH : I know, but it doesn't work with my two memory layers. Virtual Layers didn't want to show the two geometry fields from Table1, I don't know why and this is why I translate geom in WKT and reverse operation then.

    – J. Monticolo
    May 22 at 11:16











  • @Taras : are you referring to t3?

    – J. Monticolo
    May 22 at 11:17












  • @J.Monticolo, yes

    – Taras
    May 22 at 11:18















2














In QGIS, you can create a Virtual layer (Edit Menu > Create Layer > New Virtual Layer) with the code below :



SELECT t3."SI No",
t3."Link ID",
t3."Link Desc",
make_line(ST_GeomFromText(t3.ptfrom), ST_GeomFromText(t3.ptto)) AS geom
FROM (SELECT "Table2"."SI No",
"Table2"."Link ID",
"Table2"."Link Desc",
ST_AsText(t1from.geometry) AS ptfrom,
ST_AsText(t1to.geometry) AS ptto
FROM "Table2"
INNER JOIN "Table1" t1from ON "Table2"."From" = t1from."Object name"
INNER JOIN "Table1" t1to ON "Table2"."To" = t1to."Object name") AS t3


Usually, the SQL query is more simple but here, I've tried to reproduce your case with two memory layers (Table1 point, Table2 no geometry) and I had to transform point geometry into text (WKT) to have both Table1 fields.






share|improve this answer

























  • Does it make any difference to use an alias instead of a nested query?

    – Taras
    May 22 at 10:03











  • you can remove the outer query and build the line directly using the geometries make_line(t1from.geometry,t1to.geometry)

    – JGH
    May 22 at 11:07











  • @JGH : I know, but it doesn't work with my two memory layers. Virtual Layers didn't want to show the two geometry fields from Table1, I don't know why and this is why I translate geom in WKT and reverse operation then.

    – J. Monticolo
    May 22 at 11:16











  • @Taras : are you referring to t3?

    – J. Monticolo
    May 22 at 11:17












  • @J.Monticolo, yes

    – Taras
    May 22 at 11:18













2












2








2







In QGIS, you can create a Virtual layer (Edit Menu > Create Layer > New Virtual Layer) with the code below :



SELECT t3."SI No",
t3."Link ID",
t3."Link Desc",
make_line(ST_GeomFromText(t3.ptfrom), ST_GeomFromText(t3.ptto)) AS geom
FROM (SELECT "Table2"."SI No",
"Table2"."Link ID",
"Table2"."Link Desc",
ST_AsText(t1from.geometry) AS ptfrom,
ST_AsText(t1to.geometry) AS ptto
FROM "Table2"
INNER JOIN "Table1" t1from ON "Table2"."From" = t1from."Object name"
INNER JOIN "Table1" t1to ON "Table2"."To" = t1to."Object name") AS t3


Usually, the SQL query is more simple but here, I've tried to reproduce your case with two memory layers (Table1 point, Table2 no geometry) and I had to transform point geometry into text (WKT) to have both Table1 fields.






share|improve this answer















In QGIS, you can create a Virtual layer (Edit Menu > Create Layer > New Virtual Layer) with the code below :



SELECT t3."SI No",
t3."Link ID",
t3."Link Desc",
make_line(ST_GeomFromText(t3.ptfrom), ST_GeomFromText(t3.ptto)) AS geom
FROM (SELECT "Table2"."SI No",
"Table2"."Link ID",
"Table2"."Link Desc",
ST_AsText(t1from.geometry) AS ptfrom,
ST_AsText(t1to.geometry) AS ptto
FROM "Table2"
INNER JOIN "Table1" t1from ON "Table2"."From" = t1from."Object name"
INNER JOIN "Table1" t1to ON "Table2"."To" = t1to."Object name") AS t3


Usually, the SQL query is more simple but here, I've tried to reproduce your case with two memory layers (Table1 point, Table2 no geometry) and I had to transform point geometry into text (WKT) to have both Table1 fields.







share|improve this answer














share|improve this answer



share|improve this answer








edited May 22 at 10:01









Taras

2,7673830




2,7673830










answered May 22 at 9:47









J. MonticoloJ. Monticolo

2,153522




2,153522












  • Does it make any difference to use an alias instead of a nested query?

    – Taras
    May 22 at 10:03











  • you can remove the outer query and build the line directly using the geometries make_line(t1from.geometry,t1to.geometry)

    – JGH
    May 22 at 11:07











  • @JGH : I know, but it doesn't work with my two memory layers. Virtual Layers didn't want to show the two geometry fields from Table1, I don't know why and this is why I translate geom in WKT and reverse operation then.

    – J. Monticolo
    May 22 at 11:16











  • @Taras : are you referring to t3?

    – J. Monticolo
    May 22 at 11:17












  • @J.Monticolo, yes

    – Taras
    May 22 at 11:18

















  • Does it make any difference to use an alias instead of a nested query?

    – Taras
    May 22 at 10:03











  • you can remove the outer query and build the line directly using the geometries make_line(t1from.geometry,t1to.geometry)

    – JGH
    May 22 at 11:07











  • @JGH : I know, but it doesn't work with my two memory layers. Virtual Layers didn't want to show the two geometry fields from Table1, I don't know why and this is why I translate geom in WKT and reverse operation then.

    – J. Monticolo
    May 22 at 11:16











  • @Taras : are you referring to t3?

    – J. Monticolo
    May 22 at 11:17












  • @J.Monticolo, yes

    – Taras
    May 22 at 11:18
















Does it make any difference to use an alias instead of a nested query?

– Taras
May 22 at 10:03





Does it make any difference to use an alias instead of a nested query?

– Taras
May 22 at 10:03













you can remove the outer query and build the line directly using the geometries make_line(t1from.geometry,t1to.geometry)

– JGH
May 22 at 11:07





you can remove the outer query and build the line directly using the geometries make_line(t1from.geometry,t1to.geometry)

– JGH
May 22 at 11:07













@JGH : I know, but it doesn't work with my two memory layers. Virtual Layers didn't want to show the two geometry fields from Table1, I don't know why and this is why I translate geom in WKT and reverse operation then.

– J. Monticolo
May 22 at 11:16





@JGH : I know, but it doesn't work with my two memory layers. Virtual Layers didn't want to show the two geometry fields from Table1, I don't know why and this is why I translate geom in WKT and reverse operation then.

– J. Monticolo
May 22 at 11:16













@Taras : are you referring to t3?

– J. Monticolo
May 22 at 11:17






@Taras : are you referring to t3?

– J. Monticolo
May 22 at 11:17














@J.Monticolo, yes

– Taras
May 22 at 11:18





@J.Monticolo, yes

– Taras
May 22 at 11:18










Akhilesh jj is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Akhilesh jj is a new contributor. Be nice, and check out our Code of Conduct.












Akhilesh jj is a new contributor. Be nice, and check out our Code of Conduct.











Akhilesh jj is a new contributor. Be nice, and check out our Code of Conduct.














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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f323529%2fconnect-points-using-line-different-table-in-qgis3%23new-answer', 'question_page');

);

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







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form