Question

Using a Length attribute and a start x, y on a road network to find the end x, y

  • 8 January 2016
  • 4 replies
  • 2 views

I have a road network (with vectors all in correct direction of travel). I have a number of coordinate pairs (call these the start lat longs) that are found on the network. Each start lat long has an assigned Lenght attribute (ranging from 2m - 300m), What I'm having trouble with is locating an end lat long coordinate pair (on the network) using the Length attribute. I know how to get the length to point and extract end coordinates (using -1 in the transformer), but is there someway in fme to combine the Length to point transformer and add the Length attribute to then be able to extract the end lat longs? Thanking you in advance. Lea


4 replies

Userlevel 2
Badge +12

I suppose you could use the Snipper transformer to cut off the part of the line (starting at 0 ending at the wanted length. Then use the CoordinateExtractor to retrieve the coordinates of the new endpoint (index -1).

I suppose you could use the Snipper transformer to cut off the part of the line (starting at 0 ending at the wanted length. Then use the CoordinateExtractor to retrieve the coordinates of the new endpoint (index -1).

So the work flow would be

Determine which vector the start lat long was on

Nearest nieghbor

Calcuate the length to point on the vector (measure 1)

Add measure 1 to the lenght value in the attrbute

Expression calculator to get result value

Then use snipper based on the different result values? Will see if snipper can use different lengths.

Cheers

Userlevel 2
Badge +17

If the "Length" means the length measured along the road (polyline), the Snipper (Snipping Mode: Distance) would be useful, as @erik_jan suggested. However, if the "end lat long" means a point whose location is determined by the vector direction and the "Length" (straight distance from the start point), you can calculate its coordinates with simple math expressions.

Assuming

  • (xs, ys) = coordinates of the start point
  • (ux, uy) = the unit vector
  • L = the "Length" (straight distance from the start point)

then, coordinates of the "end lat long" (xe, ye) are:

  • xe = xs + ux * L
  • ye = ys + uy * L
Badge +3

or use gonio..

dX )))

)))

Angle iof vector of course.

Reply