Skip to main content

Updated:

It looks like geometry comparisons are working, but there is a slight difference for how coordinates are stored in AGOL compared to FGDB's; coordinates were off by only a few micrometers. I've had luck using the CoordinateRounder tool and setting the precision to 3 decimal places. Also, instead of using FeatureMerger, I've found that the inputs and outputs of UpdateDetector is a lot more intuitive. The graphic below shows the results as 6 updated features (2 features with attributes modified, 4 with geometry edits), 8 deleted features, 16 new inserted features, and 248 features that were unchanged.

------

Original Question:

------

I am trying to update features from a FileGeodatabase (FGDB) to a hosted ArcGIS Online Feature Layer. I'm using @LauraAtSafe tutorial on "How do I write updates to an existing ArcGIS Online feature service?" and I've hit a snag. My results are not showing edited features, and all be the new and deleted features are saying they need to be updated, even though a small subset of them need to be updated.

The FeatureMerger method allows you to just update and delete features that have been modified, added, or deleted. The AGOL Reader takes the place of the requestor, and the FGDB reader takes the place of the supplier. Since I have no unique identifier in the field data for my features, I am using the ArcGIS GlobalID Field to make the join.

Note: For anyone who's attempting to do this, AGOL stores Global ID's slightly differently than they appear in FGDB's. Set the requester value to {@UpperCase(@Value(GlobalID))} to make the AGOL Global ID Match the FGDB Global ID. Thanks @MarkAtSafe for this one.

I've updated all of the features so that AGOL and the FGDB have all the same features with "matching" Global IDs (See note above), so all of the features are the same. After they were uploaded, I went into my FGDB and made some modifications:

* Modified the attributes of 2 features

* Modified the geometry of 4 features

* Deleted 8 features

* Created 16 features

When I ran the Feature Merger, the results were not what I expected.

From the graphic above, I expected to see somewhere that listed the 6 modified features that needed to be updated, but all I saw was the 16 new features, the 8 deleted features, and the remaining features that were left over. Essentially, there should be 248 features that don't need to be changed in AGOL, 8 that need to be deleted, 6 that need to be modified, and 16 that need to be added (for a total of 22 updates and 8 deletes).

I'm not sure exactly what I'm doing wrong. Here's the FeatureMerger window to show the settings:

My only guess as to why this is failing is that, after the join, the FeatureMerger is still comparing the GlobalIDs, which do no match; AGOL stores them as an actual GlobalID Type while the FGDB stores them as a char. I am not sure how to prevent the FeatureMerger from comparing GlobalIDs after the join.

Hi @mbradbury,

  • Deleted 8 features
  • Created 16 features
Is it true? If "Sewer Clean Outs" (upper) was the current AGOL feature type and "sCleanOuts" (lower) was the new FGDB feature type, the deleted 8 features should be output via the UnmergedRequestor port and the created 16 features should be output via the UnusedSupplier port, unlike the result shown in your screenshot. Firstly make sure if the numbers of deleted/created features, or connections between the feature types and the Requestor/Supplier ports are correct.

Then, be aware that the FeatureMerger cannot be used to detect modified features. In your case, the FeatureMerger just has merged 254 pairs of Requestor feature and Supplier feature having the same GlobalID.

Consider using the ChangeDetector or the UpdateDetector (from FME Hub) rather than the FeatureMerger, if you need to detect features whose geometry and/or some attributes have been modified.


Hi @mbradbury,

  • Deleted 8 features
  • Created 16 features
Is it true? If "Sewer Clean Outs" (upper) was the current AGOL feature type and "sCleanOuts" (lower) was the new FGDB feature type, the deleted 8 features should be output via the UnmergedRequestor port and the created 16 features should be output via the UnusedSupplier port, unlike the result shown in your screenshot. Firstly make sure if the numbers of deleted/created features, or connections between the feature types and the Requestor/Supplier ports are correct.

Then, be aware that the FeatureMerger cannot be used to detect modified features. In your case, the FeatureMerger just has merged 254 pairs of Requestor feature and Supplier feature having the same GlobalID.

Consider using the ChangeDetector or the UpdateDetector (from FME Hub) rather than the FeatureMerger, if you need to detect features whose geometry and/or some attributes have been modified.

Hi @takashi,

 

 

Yes, the feature edits are all numbered correctly, which did confuse me as well with how the outputs of the FeatureMerger are labeled. I used ArcMap to modify the data in the FGDB, and simply mofied the attributes of two points, moved 4 points, deleted 8 points, and created a 4x4 array of points for the 16 new features.

 

 

I'll give ChangeDetector a try.
Hi @takashi,

 

 

Yes, the feature edits are all numbered correctly, which did confuse me as well with how the outputs of the FeatureMerger are labeled. I used ArcMap to modify the data in the FGDB, and simply mofied the attributes of two points, moved 4 points, deleted 8 points, and created a 4x4 array of points for the 16 new features.

 

 

I'll give ChangeDetector a try.
Okay @takashi, so after testing for a while, it looks like UpdateDetector is going to be my best bet. I got it to correctly identify changes in attributes, new features, and deleted features; however, it is not able to detect changes in geometry, and I suspect that there are conflicts with how geometry is being stored in AGOL compared to the FGDB. Even after creating fields for X and Y and comparing the point location that way, it still doesn't match.

 

 

An interesting thing to note about the UpdateDetector is that I can use the normal GlobalID field for both AGOL and the FGDB to make the comparison and it will actually match them up. The only difference is that it will display any feature with modified attributes as being "Deleted" and "Inserted", instead of just "Updated" compared to if I use a properly formatted string to make the compare the GlobalIDs (using {}'s and upper case letters to match the format of GlobalID in the FGDB). I'll see what the X and Y fields look like when exported to see why they aren't matching.

 

 

----

 

Edited

 

The geometries are indeed different. Here are the coordinates for one test point:

 

(6820635.546271116, 1850772.9857384413) - FGDB XY's

 

(6820635.546271048, 1850772.9857463976) - AGOL XY's

 

 

I can fix this with Point features by creating XY fields, but I'm out of luck with line or polygon features with multiple verticies. Is there a way to snap features or truncate the geometry values for comparisons? The "Lenient Geometry Matching" option did not resolve this issue.

 

 

----

 

Edited

 

Using the CoordinateRounder solved this problem. I think we have a winner.

Reply