Subscribe to this thread
Home - General / All posts - Creating a line from Points from 2 different layers
micahangeli78 post(s)
#17-Dec-12 07:23

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!

Sloots

678 post(s)
#17-Dec-12 08:05

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

odiruoL9 post(s)
#16-Apr-14 16:08

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)]

tjhb
10,094 post(s)
#17-Apr-14 00:47

but it doesn't seem to work

You should always try to avoid this phrase!

What actually happens, when you run the query?

odiruoL9 post(s)
#21-Apr-14 14:34

absolutely nothing. It runs, no errors and no results.

odiruoL9 post(s)
#21-Apr-14 14:39

here's the project

Attachments:
Analise_transportes.map

odiruoL9 post(s)
#21-Apr-14 15:44

my bad. I didn't select the points prior to running the query.

krnadik54 post(s)
#30-Apr-14 02:46

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!

tjhb
10,094 post(s)
#30-Apr-14 04:58

...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.

volker

1,086 post(s)
#14-May-14 08:32

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

Sloots

678 post(s)
#14-May-14 09:23

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

volker

1,086 post(s)
#14-May-14 11:10

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

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.