Skip to main content
Question

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

  • February 18, 2022
  • 3 replies
  • 56 views

spiderman
Contributor
Forum|alt.badge.img+7

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

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • February 18, 2022

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?


spiderman
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • 64 replies
  • February 18, 2022

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 ?

 

 


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • February 18, 2022

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.