JSONFlattener
Flattens JSON (JavaScript Object Notation) objects, extracting the object keys and values into FME feature attributes.
For example, consider a feature which has an attribute namedjsoncontaining the following text:
{ "paramName":"GeocodeResult", "dataType":"GPFeatureRecordSetLayer", "value": { "geometryType":"esriGeometryPoint", "spatialReference": {"wkid":4326 } } }
After going through the JSONFlattener, the following attributes will have been added to the feature:
Attribute Name | Attribute Value |
---|---|
paramName | 地球议员 |
dataType | GPFeatureRecordSetLayer |
value.geometrytype. | Esrigeometrypoint. |
value.spatialReference.wkid | 4326 |
Output Ports
成功处理的功能将通过此端口输出。
Features which could not be successfully processed will be output through this port. Typically this happens when the attribute specified in theJSON Attributeparameter does not have a value, or has a value that is not valid JSON.
Parameters
Input Parameters
The source JSON document. The JSON document can come from any string expression, including attribute values and workspace parameters.
Flattening Parameters
If this parameter is set toNo, each JSON object key will become an attribute and the corresponding JSON value will become the attribute value. If this parameter is set toYes, only object values which are simple types (integers, strings, etc) will become attribute values, while nested objects and arrays will be recursively flattened, as shown in the above example.
该参数可用于提供一个字符串,用于前缀新创建的属性。
暴露任何属性,以便其他变换器可以使用它们。直接在文本框中输入或单击“浏览”按钮以显示编辑器并在那里添加属性。
Error Handling Parameters
Name of the list attribute that contains information on JSON validation errors. The features that exit the transformer through the
- Error description
- Line number where the error occurred
- Column number where the error occurred
- Error type/severity
Note:List attributes从工作台中的输出架构无法访问,除非首先使用在它们上操作的变压器处理它们,例如ListExploderorListConcatenator. All list attribute transformers are displayed in the Contents pane of the Transformer Help underLists. Alternatively,AttributeExposercan be used.
FME Licensing Level
FME Professional edition and above
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click在适用的参数。更多的备用ion, seeTransformer Parameter Menu Options.
Transformer Categories
搜索FME知识中心
搜索有关此变压器的样本和信息FME Knowledge Center.