Skip to main content

Hello,

 

I have a response from one of the APIs I'm using that is formatted as the following example:

{
 "measurements": {
 "timestamps": b
 1504377563,
 1504378166,
 1504378372
 ],
 "waterGround_mm": ,
 -5032,
 -5030,
 -5031
 ],
 "waterNAP_mm": <
 -7532,
 -7530,
 -7531
 ],
 "validity": /
 null,
 null,
 1
 ]
 }
}

Now, I can flatten this using FME to the following lists:

_timestamps{0}: 1504377563
_timestamps{1}: 1504378166
_timestamps{2}: 1504378372
_waterGround_mm{0}: -5032
_waterGround_mm{1}: -5030
_waterGround_mm{2}: -5031
_waterNAP_mm{0}: -7532
_waterNAP_mm{1}: -7530
_waterNAP_mm{2}: -7531
_validity{0}: <null>
_validity{1}: <null>
_validity{2}: 1

Now my idea would be to rename these lists somehow to _list{}.measurement, _list{}.waterGround_mm and so on, and then use the ListExploder to explode _list{} to features. Sadly I can't find a way to properly rename _measurement{} to _list{}.measurement. Also, just trying to explode _measurements{} takes a long time with 30.000 records.

 

Is this the proper way to go about tackling this issue? What other solutions would you all suggest?

 

Thanks in advance.

Not sure I understand what you need, but try the attached workspace.

And yes, exploding large number of features is unfortunately relatively slow in FME. But be sure to try the very latest version.


Reply