Question

How to deal with json and convert them to attributes to use later at the workspace

  • 18 February 2022
  • 3 replies
  • 2 views

Badge +3

How to convert the json to attributes so i can use it later in the workspace

part of json :

 

{

    "content": [

        {    

            "id": "89732" ,

....................................

 

i have used jsonflattener but i found that i got missing data .

Thanks in advance

FME 2020.2


3 replies

Userlevel 5
Badge +25

Another one to try would be the JSONFragmenter (I always mix those two up). Try this as query:

json[*][*]

And set it to flatten query results into attributes.

 

Can you share what you have tried so far?

Badge +3

Another one to try would be the JSONFragmenter (I always mix those two up). Try this as query:

json[*][*]

And set it to flatten query results into attributes.

 

Can you share what you have tried so far?

Thanks .it is working , this method shows id and other items but i have inside the json content  also"geometry":{"coordinates":[x,y],"type":"Point"}

 

but i got missing when i want to show coordinates .what should i do ?

 

 

Userlevel 5
Badge +25

Thanks .it is working , this method shows id and other items but i have inside the json content also"geometry":{"coordinates":[x,y],"type":"Point"}

 

but i got missing when i want to show coordinates .what should i do ?

 

 

It would really help if you could post the full json structure here.

 

Also... if you have the json in an attribute and want to build the geometry that's in there you can simply use the GeometryReplacer, set it to GeoJSON as geometry type. Assuming whoever designed the structure didn't find a create way of storing the geometry it should work.

Reply