Question

Inesrting existing objectIDs into a relationship class...?

  • 10 June 2013
  • 5 replies
  • 3 views

Badge +5
Hi All,

 

I'm new to FME but not to ESRI and file geodatabase design.

 

I've set up the file geodatabase with a spatial line feature class, a heirachical table to hold a list of group names and a relationship class to associate the lines with a group record.

 

I can populate the relationship class in ArcMap (it populates with the OBJECTIDs of the line and the OBJECTIDs of the group record) but I want to do this using FME.

 

I have seen and followed the tutorial outlining how to add attachments using a relationship class here (http://evangelism.safe.com/fmeevangelist100/) but that example matches the data in a field of the feature class to the filename of the photo and creates new objectIDs using a Counter. I want to be able to force an INSERT into the relationship class using the existing objectIDs of the lines and the groups. How can I accomplish this?.

 

I'm using Arc10.1 and FME2012.

 

Thanks in advance for your helpful comments,

 

B

5 replies

Userlevel 4
Hi,

 

 

here is an explanation on how to do it on the FME Evangelist.

 

 

David
Badge +5
Thank you but...that's a link to the same link I had in my comment. That example matches the data in a field of the feature class to the filename of the photo and creates new objectIDs using a Counter. I want to be able to force an INSERT into the relationship class using the existing objectIDs of the lines and the groups.

 

B
Userlevel 4
Hi,

 

 

sorry about that... Given feature class A and B with relationship class R, I would do the following:

 

  • AttributeRenamer on A.OBJECTID to OBJID_A
  • AttributeRenamer on B.OBJECTID to OBJID_B
  • FeatureMerger on features A and B, using a common attribute (not OBJECTID)
  • In the FeatureMerger, enable Process Duplicate Suppliers
  • Connect the COMPLETE and DUPLICATE_SUPPLIER to an AttributeRenamer
  • Rename OBJID_A and OBJID_B to the foreign keys defined in the relationship class
  • Send to writer
Hopefully this should do the trick.

 

 

David
Badge +5
Fantastic solution; thank you! It certainly pointed me in the right direction.

 

 

 

I renamed the OBJECTIDs to their final counterparts and made sure I filtered the groups table down to only one entry so it would do a 1:M join. Then I added the relationship attributes needed to write the records out at the end. Works like a charm! :-)

 

In this case, the REQUESTOR and the SUPPLIER on the FeatureMerger just happen to share a common field but...what if they didn't? How could I force the join of the two features without a common field, i.e. I want to associate IDs 1,2,3 and 4 in one table with ID 256 of another table...?

 

I tried using mis-matched fields between them and used the INCOMPLETE output but was not able to get the records out past the transformer.

 

Thanks again for this!

 

B

 

Badge +5
Still wondering about this: 

 

How could I force the join of the two features without a common field, i.e. I want to associate IDs 1,2,3 and 4 in one table with ID 256 of another table...?

 

 

I am now thinking that the only way would be to run the data through a PythonCaller and force the relationship there using code before outputting to the relationship table.

 

Any thoughts?

 

TIA

 

B

Reply