Skip to main content

A few years ago I created a FME-hub custom transformer InlineGeoJSON. It creates a GeoJSON file with FeatureCollections. The transformer works fine in fme 2020, but does not work in versions starting from FME 2021. This has something to do with the dynamic schema setup.

The current error is:

 

GEOJSON writer: Unknown feature type 'GeoJSON' passed to the JSON writer

InlineGeoJSON_FeatureMerger (ReferenceFactory): GEOJSON writer: Unknown feature type 'GeoJSON' passed to the JSON writer

 

I tried many different solutions, for example:

  • replacing the schemasetter with the new schemascanner
  • changing the schema definition name
  • changing the feature type name

I added my workspace with the current test workspace. Does anyone have an idea how to solve this?

Hi @koenterralytics​ ,

I think the issue in this particular workspace is that there is no schema associated with the features being sent into the FeatureWriter. I'm not familiar with this custom transformer but breaking it down into a simpler example, it appears the FeatureWriter will run successfully when the attribute definition is set to Manual with no attribute; however, it will fail with a similar error when set to Dynamic and there is no schema detected (tested in 2022).

imageIn this example I removed all attributes and set the FeatureWriter to Dynamic Schema Definition.

 

In the InlineGeoJSON transformer parameter, if you specify a GeoJSON property to use, this appears to resolve the issue but I will investigate this further and update this post with my findings.


Hi @koenterralytics​ ,

I think the issue in this particular workspace is that there is no schema associated with the features being sent into the FeatureWriter. I'm not familiar with this custom transformer but breaking it down into a simpler example, it appears the FeatureWriter will run successfully when the attribute definition is set to Manual with no attribute; however, it will fail with a similar error when set to Dynamic and there is no schema detected (tested in 2022).

imageIn this example I removed all attributes and set the FeatureWriter to Dynamic Schema Definition.

 

In the InlineGeoJSON transformer parameter, if you specify a GeoJSON property to use, this appears to resolve the issue but I will investigate this further and update this post with my findings.

Hi @koenterralytics​ ,

 I'm going to convert this forum post to a case and file an issue report for our team to correct this behaviour as I was able to reproduce it on my end. Thanks for bringing this to our attention! 

After taking a second look at my test workspace and comparing it to yours, it seems the issue is consistent in 2020 as well. May I ask what version of FME you tested this in? And was the workspace the exact same in both builds you tested with? From my testing, if you use a reader instead of a Creator, the workspace runs fine. Was the workspace you compared the exact same? If not, could you upload it as well?


Hi @koenterralytics​ ,

 I'm going to convert this forum post to a case and file an issue report for our team to correct this behaviour as I was able to reproduce it on my end. Thanks for bringing this to our attention! 

After taking a second look at my test workspace and comparing it to yours, it seems the issue is consistent in 2020 as well. May I ask what version of FME you tested this in? And was the workspace the exact same in both builds you tested with? From my testing, if you use a reader instead of a Creator, the workspace runs fine. Was the workspace you compared the exact same? If not, could you upload it as well?

Hi @chrisatsafe​ , thanks for testing! I tested many things last Friday, but somehow I forgot to check what happens if I keep some attributes with the AttributeKeeper in the custom transformer (which is also a parameter 'GeoJSON properties' of the custom transformer). If I add at least one attribute, it works (in all versions of FME). So to improve my custom transformer, I will add a check to keep at least one attribute.

Nevertheless, shouldn't it be possible to use a dynamic writer with no attributes? I know this won't happen very often, but it results in some unexpected behavior in this way.

 


Hi @koenterralytics​ ,

 I'm going to convert this forum post to a case and file an issue report for our team to correct this behaviour as I was able to reproduce it on my end. Thanks for bringing this to our attention! 

After taking a second look at my test workspace and comparing it to yours, it seems the issue is consistent in 2020 as well. May I ask what version of FME you tested this in? And was the workspace the exact same in both builds you tested with? From my testing, if you use a reader instead of a Creator, the workspace runs fine. Was the workspace you compared the exact same? If not, could you upload it as well?

Hi @koenterralytics​ ,

It looks like this occurs when a schema doesn't exist AND the schema definition name parameter isn't set. By default this pulls from the feature type name and in the case of the creator, this doesn't exist as the schema isn't fully set in the creator:

imageIf you use a SchemaScanner, this actually resolves the issue as the SchemaScanner generates an fme_feature_type_name attribute which is the name of the schema that was just scanned. Try using the Schema Scanner and setting the Schema Definition Name in the writer feature type as this should resolve the issue.

image


Hi @koenterralytics​ ,

 I'm going to convert this forum post to a case and file an issue report for our team to correct this behaviour as I was able to reproduce it on my end. Thanks for bringing this to our attention! 

After taking a second look at my test workspace and comparing it to yours, it seems the issue is consistent in 2020 as well. May I ask what version of FME you tested this in? And was the workspace the exact same in both builds you tested with? From my testing, if you use a reader instead of a Creator, the workspace runs fine. Was the workspace you compared the exact same? If not, could you upload it as well?

Hi Chris, I tried to add a schema within the custom transformer using the old SchemaMapper. I also tried the SchemaScanner last friday and I think it resulted in the same error. But since I want to try to keep my transformer available starting from fme 2019.x, I try to avoid to use the schemascanner.

 

However, in the mean time I updated my custom transformer in the FME hub with an extra requirement for at least one attribute. A bit of a work around, but it does the job. So many thanks for your help!


Reply