Skip to main content
Solved

Remove z-coordinates in a linestring


rmpayaby
Contributor
Forum|alt.badge.img+3

I have a csv-file containing WKT's, and I want to use GeometryReplacer.

 

However, I want to remove the z-coordinates in the linestring. The linestring is formatted like this:

LINESTRING (252388.4 6630392.1 39.726, 252360.1 6630378.5 38.626, 252350.3 6630372.4 38.626)

What's the fastest way to do this in FME?

 

 

Best answer by geomancer

First replace the geometry using the GeometryReplacer, and then remove all Z values with the 2DForcer.

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

3 replies

geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • Best Answer
  • May 9, 2023

First replace the geometry using the GeometryReplacer, and then remove all Z values with the 2DForcer.


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • May 9, 2023

Just for the fun of it, and just because we can: 

You can also remove the z values from the WKT using a regular expression in a StringReplacer.

Remove_Z_by_regexThe regular expression in Text To Replace is:

\d+\.?\d*(?=[,)])

Note that the regular expression starts with a space!

The regular expression parsed:

  •  \d+\.?\d* Find a space, followed by a number (a number consists of one or more digits, optionally followed by a dot, optionally followed by digits) ...
  • (?=[,)]) ... which is followed by a comma or a right parenthesis

and replace the space and the number with nothing.


Ok, thanks. Ok, thanks. I would like to help you by sharing the https://www.grabmyessay.com/samples/category/sociology website with you where you can find essay samples. I am also using that website whenever I want to write essay assignments.


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