Skip to main content
Solved

ASCII point and line .xyz export to DEMGenerator

  • January 17, 2013
  • 1 reply
  • 54 views

Hey Geos,  Has anyone built a workbench the reads in ASCII point and line file and generates either the RasterDEMGenerator or DEMGenerator?  The ASCII breakline contains 4 fields (X, Y, Z, start/stop[1]).  The breakline has a 1 at the start of the breakline then 0 for each vertice, then a 1 for the end of the breakline.  I am unable to figure out how to have the transformer reads the breakline.xyz file.  This breaklines are seperate from the ASCII point files.  Looking for some help with this head scratcher. 

 

THANKS.

Best answer by takashi

Hi,

 

 

Creating line geometries from a series of coordinate values is realized by using 2D/3DPointReplacer and PointConnector, I think it's a general way on FME. In your case, I suppose the point would be how to append a new attribute which indicates Line ID to each coordinate feature (vertex). If each vertex has Line ID, you can create separate lines by setting the attribute name to "Connection Break Attribute" parameter of PiontConnector.

 

  Several transformers - Counter, Testers, VariableSetters, VariableRetrievers - occurred in my head, but assembling them might be a little complicated, and it's very difficult to explain it with my poor English skill... (:-( So, I'd provide you a sample script which can be used with PythonCaller instead of those transformers:   import fmeobjects   # global variables isStartVertex = True lineId = -1   # assumes 'flag' is the name of start/stop attribute. # flag = 1: start or stop vertex # flag = 0: intermediate vertex def setLineId(feature):     global isStartVertex, lineId     if int(feature.getAttribute('flag')) == 1:         if isStartVertex:             lineId = lineId + 1             isStartVertex = False # next 'flag = 1' vertex is not start (is stop)         else:             isStartVertex = True # next 'flag = 1' vertex is start     feature.setAttribute('_line_id', lineId)  
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • Best Answer
  • January 18, 2013
Hi,

 

 

Creating line geometries from a series of coordinate values is realized by using 2D/3DPointReplacer and PointConnector, I think it's a general way on FME. In your case, I suppose the point would be how to append a new attribute which indicates Line ID to each coordinate feature (vertex). If each vertex has Line ID, you can create separate lines by setting the attribute name to "Connection Break Attribute" parameter of PiontConnector.

 

  Several transformers - Counter, Testers, VariableSetters, VariableRetrievers - occurred in my head, but assembling them might be a little complicated, and it's very difficult to explain it with my poor English skill... (:-( So, I'd provide you a sample script which can be used with PythonCaller instead of those transformers:   import fmeobjects   # global variables isStartVertex = True lineId = -1   # assumes 'flag' is the name of start/stop attribute. # flag = 1: start or stop vertex # flag = 0: intermediate vertex def setLineId(feature):     global isStartVertex, lineId     if int(feature.getAttribute('flag')) == 1:         if isStartVertex:             lineId = lineId + 1             isStartVertex = False # next 'flag = 1' vertex is not start (is stop)         else:             isStartVertex = True # next 'flag = 1' vertex is start     feature.setAttribute('_line_id', lineId)