Hi there, I'm using the UpdateDetector transformer and it's detecting changes with lat/long fields where numerically there's no difference. This is because in one reader (the CVS reader) these two fields have trailing zeros, while in the other reader (an oracle table) they do not. What's the best way to resolve this?
Hi @ieukcoca, you can cast the internal data type of the attributes from character string to floating point number using the @double function in the ExpressionEvaluator, and then compare it with the value from the Oracle dataset.
Hi @ieukcoca,
Alternatively you can try the StringFormatter to truncate the CSV values (.2f for 2 decimals) before the comparison.
Hope this helps.
Another way of doing this would be to create a point geometry from both source lat/long attributes (Setting the CSV attribute types to X-coordinate and Y-coordinate or using the VertexCreator transformer).
The geometry should be the same as both sources will be interpreted as numeric fields.
One suggestion that could be to use a StringReplacer on the data that has trailing zeroes. Use a Regular Expression Replace and use the Regex "(0+)$" without the quotes. Leave the replacement text field blank and it will drop the trailing zeroes.
Another would be to use an AttributeRounder transformer on both sets of data and conform them all to a specific number of digits.