Question

Renaming Duplicate Value?

  • 1 November 2017
  • 2 replies
  • 11 views

Hi Everyone,

First post, so be nice :)

Just doing a simple task of checking for duplicates based on polygon id within a .TAB file, (eventually I want to output as a shapefile). It has returned two polygons... How can I now amend the id's of the duplicate polygons by adding say either a or b? I've got attribute manager but not sure where to go from here?

Hope that makes sense :/

Thanks very much.


2 replies

Userlevel 2
Badge +12

After the DuplicateFilter (to find the duplicates) you can prefix the attributes of the duplicate output (let's say dup_) using the BulkAttributeRenamer.

Then you can use a FeatureMerger (Unique to Requestor, Duplicate. to Supplier) to add the duplicates attributes to the unique feature (if needed you can aggregate the polygon geometries in the FeatureMerger).

Hope this helps.

Badge +7

If you want to prefix the values rather than the field names, use DuplicateFilter then send the duplicates to AttributeCreator (or AttributeManager) to set the value to ) where PolygonID is the attribute (field) name. a is plain text and @value(PolygonID) is the existing value of the attribute. You don't need to put quotes around the plain text.

If you had 3 instances of the same polygon ID and wanted the 2 duplicates to have different prefixes, you could use a Counter between the Duplicate port of the DuplicateFilter and the AttributeCreator. However I'm not sure this will do a, b, c etc directly. You might also need an AttributeValueMapper to map 1, 2, 3 to a, b, c and so on.

Reply