Skip to main content
Solved

Hello! I would like to interpolate Z values at a 10 metre interval along lines that appear in a shapefile. Is there a transformer to do this? Thanks!


Forum|alt.badge.img

I have an Esri ArcGIS Binary Grid and a line shapefile. The shapefile was produced by the Surface Draper transformer, so it is 3D and has Z values at the verticies from the same Grid. The Z values that I would like to generate at a 10m interval can be output to a csv, instead of being applied to the shapefile: that is, I do not require verticies to be created in the shapefile at a 10m interval. Just need the interpolated Z values every `10m down the line. Thanks!

Best answer by takashi

Hi @mdumka​ ,

You can use LineDivider from FME Hub to generate 3D points with 10 m interval from the draped 3D line, then extract coordinates (x, y, z) from the 3D points with CoordinateExtractor.

View original
Did this help you find an answer to your question?

4 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • November 3, 2023

Hi @mdumka​ ,

You can use LineDivider from FME Hub to generate 3D points with 10 m interval from the draped 3D line, then extract coordinates (x, y, z) from the 3D points with CoordinateExtractor.


Forum|alt.badge.img
  • Author
  • November 3, 2023

Hi @Takashi Iijima​ , that makes sense. I wasn't aware of LineDivider. Once again FME is awesome! Thank you for your kind wisdom and prompt response. Mark


Forum|alt.badge.img
  • Author
  • November 3, 2023

How about a slightly different take on this? Instead of dividing the line on a 10m interval and thereby producing individual lines from each division, we keep the original lines but just add verticies every 10m?


Forum|alt.badge.img
  • Author
  • November 6, 2023

There is a way to reconstruct the original lines and add verticies every 10m. After using LineDivider, use Line Builder to stitch the lines back together (to the original). Then use CoordinateExtractor and Measure Extractor to pull out Z and M (the input shapefile already had Z as described in my original question: I forgot to mention it also has M at the original verticies). CoordinateExtractor and Measure Extractor have to be in 2 separate streams since we only want to produce one list at a time, and since we don't want the 2 lists to multiply each others features. The use FeatureMerger to put the 2 streams back together.

 

A problem with this approach: the original verticies were lost (except for the first and last verticies). That must be because LineDivider dropped them. Another problem: the measure values are not exactly at exactly 10: they are 9.99461806513725, 19.9892361302353, 29.9838541954888, etc. Not sure why.

 

Attached is a screengrab of the script. Thanks all! Mark

 


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