Question

get the points of the lanes

  • 28 August 2018
  • 5 replies
  • 1 view

Badge

Hallo!

I have the problem that i have to get every point in a lane to calculate the heading and the distance between this points. But i have no idea how i could get the size of points which are in the lanes and how i get the right coordinates in the right direction (point 1, point 2,...) out of it. I work with an template and tried to give him the lanes, but i couldn't take the nodes one by one to work with them which step i have to do before to give my template just the points/nodes of my line ? 

the subtemplate-code is:

<geometry s="{fme:get-attribute("s")}" x="{geom:get-start-x()}" y="{geom:get-start-y()}" hdg="@atan2(@YValue(),@XValue())" length="{fme:get-attribute("_length")}"> <line/> </geometry>

I also give some pictures to show how my template work at least.

I hope anyone could help me.


5 replies

Badge
The right query is that one:

 

{geom:get-x-coord()}
But he give no value because i give the template a line and not a point. How could i change the geometry type that i get all notes from a line?

 

Badge +10

Have you tried extracting coordinates into a list prior to the templater and then accessing those values within the query?

{
let $x := fme:get-list-attribute("_indices{}.x")
let $y := fme:get-list-attribute("_indices{}.y")
for $i in (1 to fn:count($x))
return
    <geometry> x="{$x[$i]}" y="{$y[$i]}" </geometry>
}    

Badge

Have you tried extracting coordinates into a list prior to the templater and then accessing those values within the query?

{
let $x := fme:get-list-attribute("_indices{}.x")
let $y := fme:get-list-attribute("_indices{}.y")
for $i in (1 to fn:count($x))
return
    <geometry> x="{$x[$i]}" y="{$y[$i]}" </geometry>
}    

If i use your code a bit edited:

 

{
let $x := fme:get-list-attribute("_indices{}.x")
let $y := fme:get-list-attribute("_indices{}.y")
for $i in (1 to fn:count($x))
return

    <geometry x="{$x[$i]}" y="{$y[$i]}"><line/> </geometry>
}

then my textfile is empty on this position.

 

 

Badge +10
If i use your code a bit edited:

 

{
let $x := fme:get-list-attribute("_indices{}.x")
let $y := fme:get-list-attribute("_indices{}.y")
for $i in (1 to fn:count($x))
return

    <geometry x="{$x[$i]}" y="{$y[$i]}"><line/> </geometry>
}

then my textfile is empty on this position.

 

 

Have you inserted the coordinate extractor prior to the xml templater so that the list exists?

 

 

Badge

Have you tried extracting coordinates into a list prior to the templater and then accessing those values within the query?

{
let $x := fme:get-list-attribute("_indices{}.x")
let $y := fme:get-list-attribute("_indices{}.y")
for $i in (1 to fn:count($x))
return
    <geometry> x="{$x[$i]}" y="{$y[$i]}" </geometry>
}    

k if i put an coordinate extractor before it works, but i want that he only put the nodes from the line into it. I have 3 lines with 2x 4 nodes and 1x 3 nodes and in summary 11. I want that he only set the nodes from the line and not every node.

 

 

    <planView>

 

       <geometry> x="534479.5085769484" y="5211763.0537863765"</geometry>

 

       <geometry> x="534514.871573565" y="5211686.678654794"</geometry>

 

       <geometry> x="534516.4251188312" y="5211683.3315199055"</geometry>

 

       <geometry> x="534516.4251188312" y="5211683.3315199055"</geometry>

 

       <geometry> x="534564.4075924826" y="5211708.18141793"</geometry>

 

       <geometry> x="534566.2854240009" y="5211709.148064895"</geometry>

 

       <geometry> x="534597.9922825961" y="5211730.102929116"</geometry>

 

       <geometry> x="534412.9472988568" y="5211648.158671195"</geometry>

 

       <geometry> x="534470.4027142564" y="5211663.538728009"</geometry>

 

       <geometry> x="534515.3872750037" y="5211682.880969166"</geometry>

 

       <geometry> x="534516.4251188312" y="5211683.3315199055"</geometry>

 

     </planView>

 

Reply