Select to view content in your preferred language

AGOL layer visibility resets when using FME Feature Service Writer with 'Truncate Existing'

257
3
Jump to solution
a month ago
NikSandsTP
Occasional Contributor

In FME Workbench 2023.1, I'm using the ESRI ArcGIS Online Feature Service Writer to update a layer in AGOL with data from a local fGDB. I have the writer configured as per the screenshot below.

After it runs, the layer in AGOL is visible when zoomed all the way out! (This was not previously the case).

So, then I republish the layer in ArcGIS Pro and it fixes the layer so that it now disappears when zoomed out (I could also do this directly in AGOL).

I then change the FME writer to ‘Use Existing’ (and not ‘Truncate Existing’) and re-run the translation.

This time it works without affecting the AGOL layer visibility.

So I change the FME writer back to ‘Truncate Existing’ (and not ‘Use Existing’) and re-run the translation.

It breaks the AGOL layer visibility again!

I plan to use something like this to update many layers, and I cannot have them all visible when zoomed out. It would be a complete mess.

Am I doing something wrong? How can I update the data (including deleting features) without affecting the AGOL layer’s visibility?

(The issue occurs for both 'Insert' and 'Upsert'. I’m using ‘Truncate Existing’ so that if we delete a feature locally, this will cause it to be deleted on AGOL. Perhaps there is a better way to do this? But that would be another question entirely.)

Screenshot 2024-09-18 133735.jpg

0 Kudos
1 Solution

Accepted Solutions
NikSandsTP
Occasional Contributor

Huh, it is looking like this is a bug in AGOL.  I have just replicated the same behaviour using only ArcGIS Pro.

If (in ArcGIS Pro) I simply run the Truncate tool on the AGOL layer, it resets that layer's visibility to be visible at all zoom scales in AGOL!  I then run an Append, to repopulate the data, and it remains visible at all zoom scales.  Not good.

I'm going to log this with ESRI support.

View solution in original post

0 Kudos
3 Replies
ChristopherCounsell
MVP Regular Contributor

Something in the FME Writer configuration is overwriting the service. It recreates the layer. This is what resets the symbology / layer settings. The same would happen in ArcGIS Pro if you published to overwrite an existing layer.

The fme documentation suggests there are additional parameters on using existing or creating services. It also advises caution with using truncate existing in some contexts.

You will need to review the other parameters and documentation so that the service is not overwritten if it exists already.

0 Kudos
NikSandsTP
Occasional Contributor

I'm not 100% convinced that it is overwriting the service because it does not alter the symbology, the labels or the custom (arcade) pop-ups.

(Note that FME cannot send the symbology, labels or pop-ups configuration. It doesn't have access to this. It is only accessing the source data as feature classes from the local database directly and not accessing any layers.)

Here's some other odd behaviour: Although the layer visibility gets reset to display at all zoom-scales, the label visibility remains at the original zoom-scale range as the layer itself originally had. The labels never had any explicit visibility range set - it was just inherited from the layer itself.

The FME writer in this case is not using 'create' or 'overwrite' but is set to 'Use Existing'.  Here's what the FME AGOL Feature Service Writer documentation says about 'Truncate Existing':

  • Truncate Existing - Attempt to remove all the features or attachments in a hosted feature service Layer before writing features. If the Layer does not exist, the translation will fail.
    • If the Layer supports truncation, this option supports deleting all features or attachments in a hosted feature service layer.
    • If the Layer does not support truncation (or the operation fails), the writer performs a truncation by reading all feature IDs from the layer, and then making deletion requests in batches according to the advanced writer parameter Features Per Request.

There is nothing there that suggests it would be overwriting the hosted feature layer.  It explicitly says that it would just remove all the features.

0 Kudos
NikSandsTP
Occasional Contributor

Huh, it is looking like this is a bug in AGOL.  I have just replicated the same behaviour using only ArcGIS Pro.

If (in ArcGIS Pro) I simply run the Truncate tool on the AGOL layer, it resets that layer's visibility to be visible at all zoom scales in AGOL!  I then run an Append, to repopulate the data, and it remains visible at all zoom scales.  Not good.

I'm going to log this with ESRI support.

0 Kudos