Skip to main content
Solved

ASCII point and line .xyz export to DEMGenerator

  • January 17, 2013
  • 1 reply
  • 37 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)  
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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
Influencer
  • 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)  

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings