5

I have a set of linestrings which are contaminated by points being almost duplicate.

Example:

X------XX--------X-X-----X----XX-------X

I would like to remove the duplicates using a tolerance on the geometry, leaving me with a set of clean linestrings:

X------X---------X-X-----X-----X-------X

I know its probably a simple question, but being new to FME i could use a simple educative hint or answer :)

1

1 Answer 1

4

There are quite a few options depending on exactly what you want, so I'll list several.

Duplicate Point removal

For points that are on the same spot, there are actually a lot of transformers that will remove the duplicates as part of their process, but the one you'd want would be: DuplicateCoordinateRemover This one will only get rid of duplicate points that are on the exact same spot.

Tolerance

If you want to remove points that are within a certain tolerance then the Snapper is probably the answer. Set it to "vertex snapping" and before it place a Counter. Use the attribute that the counter creates for the "Group By" of the Snapper. This way features will only be snapped to themselves. So you'll have something like:

Input ---> Counter ---> Snapper ----> Output

Line Generalisation

The final option is to use a generalizer (American spelling). You'll probably want to experiment to see which algorithm to use and they're designed for something slightly different.

Just using one of them (probably the snapper) should be sufficient, but you'll want to test them for best results in your situation.

2
  • 1
    If I can accept a bit of rounding, CoordinateRounder is also an option.
    – Chau
    Commented Apr 17, 2012 at 11:11
  • Yep, also an excellent option. Its also good for reducing file-sizes too when the source data has far too many decimal points. Commented Apr 17, 2012 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.