Skip to main content
Question

CoordinateReplacer replaces too much

  • July 31, 2017
  • 2 replies
  • 26 views

Forum|alt.badge.img

Hello,

I discovered the CoordinateReplacer, a great strong transformer for many purposes.But now I have the following issue with it:

I got 2 coördinates with different xy but equal z values. Of one of these coordinates I need to replace the values by a new value. CoordinateReplacer seems a great way to do that. However, it also replaces the z-value of the correct coordinate. I was hoping it would only replace the z-value if he'd found matching x- and y- values as well, but unfortunately it seems to work more like an OrdinateReplacer. Does anyone have any idea how to workaround this?

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.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+62

You could use a GeometryExtractor to store the geometry in an attribute, if you select OGC WKT as the format it'll be human-readable format, then you can use a StringSearcher to search for the correct coordinates, everything that does not match (i.e. everything you want to change) goes to the CoordinateReplacer and then afterwards you bring both streams back together again.


verdoodtdries
Supporter
Forum|alt.badge.img+23

You could use a GeometryExtractor to store the geometry in an attribute, if you select OGC WKT as the format it'll be human-readable format, then you can use a StringSearcher to search for the correct coordinates, everything that does not match (i.e. everything you want to change) goes to the CoordinateReplacer and then afterwards you bring both streams back together again.

Hi redgeographics, I like your proposed workaround.

 

 

However, if your data only contains point features, the same results can be obtained using the transformers CoordinateExtractor, followed by a TestFilter. First extract _x, _y and _z coordinates. Filter out the points you need to replace with the CoordinateReplacer, and finally bring both streams of features back together.

 

 

You can use this solution if you're not yet familiar with WKT-geometry and regular expression matching within the StringSearcher transformer.