Question

How to grab all geometries from nested json object and create multiple geometries

  • 28 May 2019
  • 1 reply
  • 5 views

Badge +3

In my case , [json file attached]There are Multiple geometry entries in one json file. The challenge here is, it is not in one location or one array. it scattered around nested array. I need to create features for all geometries in json file. i mean wherever geometry comes, we need to create features. is there any way to create geometries in one go.


1 reply

Userlevel 2
Badge +17

Hi @fkemminje,

The geometry stored at different levels of the JSON hierarchy might be able to be extracted with a complex query in the JSONExtractor. However, I was able to use a recursive function in a PythonCaller to convert the JSON into a hierarchical FME geometry, with all the properties stored as traits.

The GeometryPartExtractor and GeometryPropertyExtractor have powerful but easy to use queries that can be used to extract the geometries from the hierarchy, with their properties, as simple features.

I am attaching an annotated workspace for you.

ConvertJSONtoFMEGeom.fmw

Reply