Home -
General /
All posts - Creating a line from Points from 2 different layers
|
I have Drawing A (Points), Drawing B (Points) and Drawing C (Lines). I want to create a line to be inserted in Drawing C from 2 selected points, one from Drawing A and one from Drawing B. How do I do this via sql? Thanks!
|
|
You could try this: OPTIONS CoordSys("A" AS COMPONENT); INSERT INTO [C] ([Geom (I)]) SELECT NewLine([A].[Geom (I)], [B].[Geom (I)]) AS LINE FROM [A], [B] WHERE [A].[Selection (I)] AND [B].[Selection (I)] If you omit the second line starting with INSERT you can create a linked drawing from it that can easily be updated. Cheers, Chris
http://www.mppng.nl/manifold/pointlabeler |
|
Dear Sloots, I'm a newbie in SQL. I've tried to use your query but it doesn't seem to work. Can you help me? Thank you. OPTIONS CoordSys("PT-TM06 IGP" AS COMPONENT); INSERT INTO [RELACAO ORIGEM DESTINO Table] ([Geom (I)]) SELECT NewLine([CAOP20120 FREGUESIAS POINTS Table].[Geom (I)], [CAOP20120 MUNICIPIOS POINTS Table].[Geom (I)]) AS LINE FROM [CAOP20120 FREGUESIAS POINTS Table], [CAOP20120 MUNICIPIOS POINTS Table] WHERE [CAOP20120 FREGUESIAS POINTS Table].[Selection (I)] AND [CAOP20120 MUNICIPIOS POINTS Table].[Selection (I)]
|
|
but it doesn't seem to work
You should always try to avoid this phrase! What actually happens, when you run the query?
|
|
absolutely nothing. It runs, no errors and no results.
|
|
my bad. I didn't select the points prior to running the query.
|
|
Hi all, I've done something similar in Oracle Spatial, but now I want to try if I can use it in Manifold so I can just run the queries locally rather than uploading the drawing into the database. I just want to ask if there's a way to add coordinates in an existing line? I want to try to create a line out of existing points (which is the same case as this one), but the difference is that one line would be composed of multiple points. These points would be vertices in the line. I would highly appreciate it if someone would be able to help. Thanks!
|
|
...the difference is that one line would be composed of multiple points. These points would be vertices in the line.
That is a different situation but again very simple, provided that the points have an inherent order. You may not even need to run a query. Try posting some sample data.
|
volker1,086 post(s) |
That`s a helpfull Query. But how does it work if don`t want to have a line from selected Points but from Point to Point with the same column ? ... WHERE [A].[Column] = [B].[Column] don`t work...
http://www.thegisservicesector.de |
|
Hello volker, It seems to me that it should work. If both drawing have a table called "Column" and the values are equal it should create the line. OPTIONS CoordSys("A" AS COMPONENT); SELECT NewLine([A].[Geom (I)], [B].[Geom (I)]) AS LINE FROM [A], [B] WHERE -- [A].[Selection (I)] AND [B].[Selection (I)] [A].[Name] = [B].[Name] -- The next part return only line(s) named "P3" AND [A].[Name] = "P3" Try this.... Cheers, Chris Attachments: Draw lines between points from two drawings.map
http://www.mppng.nl/manifold/pointlabeler |
volker1,086 post(s) |
My error. I want to have a line between Points in A (my Gps-Datas) and B (the original coordinates) between the points with the same number [NR], cause i want to have the length between my original Points and the collected points from Garmin 64. But my [NR] was in A = Text and in B=float. So it not works. Now it did. Many thanks. Attachments: Line between Points.map
http://www.thegisservicesector.de |