Question

FeatureWriter and Esri ArcGIS Server Feature Service with dynamic schema fails when layername contains space

  • 18 April 2024
  • 6 replies
  • 31 views

Badge +3

I have logged a support case about my problem, but figured I might as well check to see if anyone else have encoutered this problem:

I am writing a workspace to geosynchronize a Feature Service with a database. The Feature Service contains about 30 layers that need to be updated, so I have put my bet in for a dynamic workspace, since the operation is the same for every layer. This saves me a lot of transformers and makes the maintenance of the workspace much simpler.

My challenge here is that both the FeatureReader and FeatureWriter requires the name of the layer to be passed in as a parameter, not the layerid, which would not be a problem. Almost all of these layers have names containing, at least, one space, and this is what is causing my trouble.

On the reader side, I can enclose the layer name in double quotes, like “My Layer”, and this works without problems.

On the writer side, however, things are messed up. I have so far tried three different approaches:

  1. Enter the name “as is”, like My Layer - this produces a Python error stating Python Exception <KeyError>: 'My Layer'
  2. Enclosing the name in double quotes, like “My Layer”, the writer says that it does not recognize any layer with the name _My Layer_.
  3. Enclosing the name in single qoutes, like ‘My Layer’, the writer says that i does not recognize any layer with the name ‘My Layer’.

I can see why number two fails, the writer performs a renaming of attributes “based on format constraints for invalid characters, length, and case” as reported from the writer. I have a list with attriutes like MyList{1}, which is auomatically renamed to MyList_1_, so my layer name most likely gets the same treatment.

Have anyone of you out there experienced the same and come up with a solution to this?

I have encountered this problem in FME FLow 2023.2.1 and I have tested it in FME Flow 2024.0.1 with the same result. I am performing my read/Write in a embedded custom transformer, that looks like this:

 


6 replies

Userlevel 4
Badge +18

Have you tried changing the Schema Feature you are sending to the FeatureWriter?

The fme_feature_type(s) are automatically renamed to [my_layer] because the format you are writing does not support spaces in the table names. But now the schema is sending [my layer] as the fme_feature_type_name and the FeatureWriter can't find the my_layer in de schema.

Badge +3

My format supports spaces in the name. I have made two screenshots that shows that my format definitely supports names with spaces in them. My ArcGIS Enterprise install is cuttently at 11.1.

When looking at the list of available layers in ArcGIS REST, I get a list of these names:

I have created a writer where I have imported the layers from the feature service, and the layer names show up like this in the canvas in the workbench:

 

FME has found the names with spaces and show them like that in the writer. Besides, the error message from the FeatureWriter does not refer to a layer name like My_Layer, where the space in the name has been replaced by an underscore. The reference to the layer name in the error messages are always with a space.

Userlevel 4
Badge +18

All the attribute name arrows are red. This means there is no attribute (exposed) in your workbench that matches the name of the attribute in the featurewriter.

If you use a BulkAttributeRenamer to convert the space into an underscore, does that change the red arrows to green?

Esri does not like spaces at a lot of places, so my guess would still be this is the issue.

Badge +3

The transformer in question was never connected. It was created in workbench to show the fact that layer names in FeatureReader appear with spaces as long as the layers are prefetched and not used in a dynamic workspace. Sorry about missing that information in my last post.

I am unable to rename the layers in the Feature Service as that has widespread consequences in this setup. The Feature Service is accesed from many other solutions.

ArcGIS accept putting spaces in the layer names, as the names appear with spaces both in the REST-endpoint and the FeatureReader as shown in the screenshot.

Badge +20

I can confirm the bug.

Just updated from 2023.2.1 to 2024.0.1 and FeatureReader discovers the layers but it queries them by just the first word from the layer name.

ArcGIS Feature Service Reader: Requesting metadata for Feature Service at 'https://geoportal.ancpi.ro/hosted_services/rest/services/SectoareCadastrale/SectoareCadastrale/MapServer'
The coordinate system 'Piscului70.Stero' has been deprecated. please visit http://www.safe.com/support
The ESRIWKID number of the FME coordinate system 'Piscului70.Stero' is '3844'
ArcGIS Feature Service Reader: Requesting metadata for Feature Service at 'https://geoportal.ancpi.ro/hosted_services/rest/services/SectoareCadastrale/SectoareCadastrale/MapServer'
ArcGIS Feature Service Reader: Could not find a layer/table matching feature type 'Sectoare'
Python Exception <FeatureTypeNotFoundException>: FMEException: 928219: ArcGIS Feature Service Reader: Could not find a layer/table matching feature type 'Sectoare'
An error has occurred. Check the logfile above for details

The Could not find a layer/table matching feature type 'Sectoare' is understandable since the layer name is "Sectoare cadastrale"

I attached a simple sample workspace that gives the error.

Badge +3

Nice to see that it is’n just me that can confirm the bug 🙂

Reply