Skip to main content
Question

Excel to tab


Hi all,

 

        new to FME and would like to know:

 

I have an excel sheet with a column of (Attribute id's) and a column of (lengths m).

 

I also have a tab file that relates to the excel sheet and has the same Attribute id's.

 

Can I change the spatial length of the polylines in the tab file to be the same as the lengths in the excel sheet??

takashi
Contributor
Forum|alt.badge.img+17
  • Contributor
  • August 5, 2013
Hi,

 

 

If you need to replace the attribute value (i.e. length) of features in the tab file with the length value stored in the Excel worksheet,  the FeatureMerger transformer can be used.

 

Be aware that the FeatureMerger does not overwrite same named attribute, so you should remove the length attribute from the features before merging attributes. To remove attributes, consider using the AttributeRemover transformer.

 

 

Takashi

  • August 5, 2013
Thanks for the reply, however I have a new problem.

 

The poly lines I have in my tab file are not the same length that the attribute field displays, ie; if the attribute (length m) in the tab file says 100m, for example the actual length of the polyline for that particular feature may be 110m.  How do I make the polyline redraw as per the length stated in the attribute?

 

 

Torro

takashi
Contributor
Forum|alt.badge.img+17
  • Contributor
  • August 5, 2013
Hi Torro,

 

 

You mean modifying the line geometry based on the length attribute value? If so, the Snipper (Snipping Mode = Distance (Value)) can be used to shorten and the Extender can be used to extend a line. And also the LengthCalculator probably should be used to get the lenge of a line geometry. If the coordinate value unit of the geometry data is not meter, you should change the coordinate system before those handling. To do reprojection, consider using the Reprojector transformer.

 

 

Takashi

  • August 6, 2013
Thanks Takashi,

 

yes thats right im trying to modifying the line geometry based on the length attribute value.

 

Still having a problem, what do I put in the 'snipper' fields starting Location and Ending locations?

 

 

Torro

  • August 6, 2013
Also can I use the snipper and the extender transformers in the same workbench.  The Extender transformer just seems to undo everything the snipper did??

 


takashi
Contributor
Forum|alt.badge.img+17
  • Contributor
  • August 6, 2013
Hi Torro,

 

 

Yes, you can use those transformers in the same workspace. Assume every line feature has an attribute named "attr_len" (indicating length value), this workflow performs snipping or extending at both end of the line based on the difference between "attr_len" and calculated length, for example: 

 

 

 

Takashi

Reply


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